@@ -259,7 +259,7 @@ fn vcpu_test_layout_lapic_state() {
259
259
pub use kvm_bindings:: kvm_lapic_state as LapicState ;
260
260
261
261
// Returns a `Vec<T>` with a size in bytes at least as large as `size_in_bytes`.
262
- fn vec_with_size_in_bytes < T : Default > ( size_in_bytes : usize ) -> Vec < T > {
262
+ pub fn vec_with_size_in_bytes < T : Default > ( size_in_bytes : usize ) -> Vec < T > {
263
263
let rounded_size = ( size_in_bytes + size_of :: < T > ( ) - 1 ) / size_of :: < T > ( ) ;
264
264
let mut v = Vec :: with_capacity ( rounded_size) ;
265
265
for _ in 0 ..rounded_size {
@@ -283,7 +283,7 @@ fn vec_with_size_in_bytes<T: Default>(size_in_bytes: usize) -> Vec<T> {
283
283
// for `Foo`, a `Vec<Foo>` is created. Only the first element of `Vec<Foo>` would actually be used
284
284
// as a `Foo`. The remaining memory in the `Vec<Foo>` is for `entries`, which must be contiguous
285
285
// with `Foo`. This function is used to make the `Vec<Foo>` with enough space for `count` entries.
286
- fn vec_with_array_field < T : Default , F > ( count : usize ) -> Vec < T > {
286
+ pub fn vec_with_array_field < T : Default , F > ( count : usize ) -> Vec < T > {
287
287
let element_space = count * size_of :: < F > ( ) ;
288
288
let vec_size_bytes = size_of :: < T > ( ) + element_space;
289
289
vec_with_size_in_bytes ( vec_size_bytes)
@@ -322,7 +322,6 @@ impl Clone for CpuId {
322
322
}
323
323
}
324
324
325
- #[ cfg( test) ]
326
325
impl PartialEq for CpuId {
327
326
fn eq ( & self , other : & CpuId ) -> bool {
328
327
let entries: & [ CpuIdEntry2 ] =
0 commit comments