pub struct BuddyAllocator<const N: usize, O: OligarchyCollection, B: BuddyCollection> { /* private fields */ }Expand description
伙伴分配器。
Implementations§
Source§impl<const N: usize, O: OligarchyCollection, B: BuddyCollection> BuddyAllocator<N, O, B>
impl<const N: usize, O: OligarchyCollection, B: BuddyCollection> BuddyAllocator<N, O, B>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
构造分配器。
Examples found in repository?
More examples
examples/debug.rs (line 5)
4fn main() {
5 let mut allocator = BuddyAllocator::<16, BuddySet, BuddySet>::new();
6 allocator.init(12, non_null(0x1000));
7 println!();
8 assert!(allocator.allocate_type::<usize>().is_err());
9 println!();
10 unsafe { allocator.transfer(non_null(0x1000), 0x7fff_f000) };
11
12 println!();
13 println!("A {allocator:?}");
14 let (ptr0, size0) = allocator.allocate_type::<[u8; 2048]>().unwrap();
15 println!("B {allocator:?}");
16 let (ptr1, size1) = allocator.allocate_type::<[u8; 4096]>().unwrap();
17 println!("C {allocator:?}");
18 let (ptr2, size2) = allocator.allocate_type::<[u8; 4096 * 3 - 100]>().unwrap();
19 println!("D {allocator:?}");
20
21 assert_eq!(4096, size0);
22 assert_eq!(4096, size1);
23 assert_eq!(4096 * 3, size2);
24
25 println!();
26 println!("{allocator:?}");
27 allocator.deallocate(ptr0, size0);
28 println!("{allocator:?}");
29 allocator.deallocate(ptr1, size1);
30 println!("{allocator:?}");
31 allocator.deallocate(ptr2, size2);
32 println!("{allocator:?}");
33}examples/bench.rs (line 21)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
返回分配器管理的总容量。
Examples found in repository?
examples/bench.rs (line 34)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Sourcepub fn free(&self) -> usize
pub fn free(&self) -> usize
返回分配器剩余的空间容量。
Examples found in repository?
examples/bench.rs (line 35)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Sourcepub fn init<T>(&mut self, min_order: usize, base: NonNull<T>)
pub fn init<T>(&mut self, min_order: usize, base: NonNull<T>)
运行时初始化。
设置分配器分配的最小阶数和基址。
Examples found in repository?
More examples
examples/debug.rs (line 6)
4fn main() {
5 let mut allocator = BuddyAllocator::<16, BuddySet, BuddySet>::new();
6 allocator.init(12, non_null(0x1000));
7 println!();
8 assert!(allocator.allocate_type::<usize>().is_err());
9 println!();
10 unsafe { allocator.transfer(non_null(0x1000), 0x7fff_f000) };
11
12 println!();
13 println!("A {allocator:?}");
14 let (ptr0, size0) = allocator.allocate_type::<[u8; 2048]>().unwrap();
15 println!("B {allocator:?}");
16 let (ptr1, size1) = allocator.allocate_type::<[u8; 4096]>().unwrap();
17 println!("C {allocator:?}");
18 let (ptr2, size2) = allocator.allocate_type::<[u8; 4096 * 3 - 100]>().unwrap();
19 println!("D {allocator:?}");
20
21 assert_eq!(4096, size0);
22 assert_eq!(4096, size1);
23 assert_eq!(4096 * 3, size2);
24
25 println!();
26 println!("{allocator:?}");
27 allocator.deallocate(ptr0, size0);
28 println!("{allocator:?}");
29 allocator.deallocate(ptr1, size1);
30 println!("{allocator:?}");
31 allocator.deallocate(ptr2, size2);
32 println!("{allocator:?}");
33}examples/bench.rs (line 24)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Sourcepub unsafe fn transfer<T>(&mut self, ptr: NonNull<T>, size: usize)
pub unsafe fn transfer<T>(&mut self, ptr: NonNull<T>, size: usize)
Examples found in repository?
More examples
examples/debug.rs (line 10)
4fn main() {
5 let mut allocator = BuddyAllocator::<16, BuddySet, BuddySet>::new();
6 allocator.init(12, non_null(0x1000));
7 println!();
8 assert!(allocator.allocate_type::<usize>().is_err());
9 println!();
10 unsafe { allocator.transfer(non_null(0x1000), 0x7fff_f000) };
11
12 println!();
13 println!("A {allocator:?}");
14 let (ptr0, size0) = allocator.allocate_type::<[u8; 2048]>().unwrap();
15 println!("B {allocator:?}");
16 let (ptr1, size1) = allocator.allocate_type::<[u8; 4096]>().unwrap();
17 println!("C {allocator:?}");
18 let (ptr2, size2) = allocator.allocate_type::<[u8; 4096 * 3 - 100]>().unwrap();
19 println!("D {allocator:?}");
20
21 assert_eq!(4096, size0);
22 assert_eq!(4096, size1);
23 assert_eq!(4096 * 3, size2);
24
25 println!();
26 println!("{allocator:?}");
27 allocator.deallocate(ptr0, size0);
28 println!("{allocator:?}");
29 allocator.deallocate(ptr1, size1);
30 println!("{allocator:?}");
31 allocator.deallocate(ptr2, size2);
32 println!("{allocator:?}");
33}examples/bench.rs (line 31)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Sourcepub fn snatch<T>(
&mut self,
align_order: usize,
size: NonZeroUsize,
) -> Result<(NonNull<T>, usize), BuddyError>
pub fn snatch<T>( &mut self, align_order: usize, size: NonZeroUsize, ) -> Result<(NonNull<T>, usize), BuddyError>
从分配器夺走一个对齐到 align_order 阶,长度为 size 的内存块。
Sourcepub fn allocate_type<T>(&mut self) -> Result<(NonNull<T>, usize), BuddyError>
pub fn allocate_type<T>(&mut self) -> Result<(NonNull<T>, usize), BuddyError>
分配可容纳 T 对象的内存块。
Examples found in repository?
More examples
examples/debug.rs (line 8)
4fn main() {
5 let mut allocator = BuddyAllocator::<16, BuddySet, BuddySet>::new();
6 allocator.init(12, non_null(0x1000));
7 println!();
8 assert!(allocator.allocate_type::<usize>().is_err());
9 println!();
10 unsafe { allocator.transfer(non_null(0x1000), 0x7fff_f000) };
11
12 println!();
13 println!("A {allocator:?}");
14 let (ptr0, size0) = allocator.allocate_type::<[u8; 2048]>().unwrap();
15 println!("B {allocator:?}");
16 let (ptr1, size1) = allocator.allocate_type::<[u8; 4096]>().unwrap();
17 println!("C {allocator:?}");
18 let (ptr2, size2) = allocator.allocate_type::<[u8; 4096 * 3 - 100]>().unwrap();
19 println!("D {allocator:?}");
20
21 assert_eq!(4096, size0);
22 assert_eq!(4096, size1);
23 assert_eq!(4096 * 3, size2);
24
25 println!();
26 println!("{allocator:?}");
27 allocator.deallocate(ptr0, size0);
28 println!("{allocator:?}");
29 allocator.deallocate(ptr1, size1);
30 println!("{allocator:?}");
31 allocator.deallocate(ptr2, size2);
32 println!("{allocator:?}");
33}examples/bench.rs (line 47)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Sourcepub fn allocate_layout<T>(
&mut self,
layout: Layout,
) -> Result<(NonNull<T>, usize), BuddyError>
pub fn allocate_layout<T>( &mut self, layout: Layout, ) -> Result<(NonNull<T>, usize), BuddyError>
分配符合 layout 布局的内存块。
Sourcepub fn allocate<T>(
&mut self,
align_order: usize,
size: NonZeroUsize,
) -> Result<(NonNull<T>, usize), BuddyError>
pub fn allocate<T>( &mut self, align_order: usize, size: NonZeroUsize, ) -> Result<(NonNull<T>, usize), BuddyError>
分配。
如果分配成功,返回一个 (指针, 长度) 二元组。
Sourcepub unsafe fn deallocate_layout<T>(&mut self, ptr: NonNull<T>, layout: Layout)
pub unsafe fn deallocate_layout<T>(&mut self, ptr: NonNull<T>, layout: Layout)
Sourcepub fn deallocate<T>(&mut self, ptr: NonNull<T>, size: usize)
pub fn deallocate<T>(&mut self, ptr: NonNull<T>, size: usize)
Examples found in repository?
examples/debug.rs (line 27)
4fn main() {
5 let mut allocator = BuddyAllocator::<16, BuddySet, BuddySet>::new();
6 allocator.init(12, non_null(0x1000));
7 println!();
8 assert!(allocator.allocate_type::<usize>().is_err());
9 println!();
10 unsafe { allocator.transfer(non_null(0x1000), 0x7fff_f000) };
11
12 println!();
13 println!("A {allocator:?}");
14 let (ptr0, size0) = allocator.allocate_type::<[u8; 2048]>().unwrap();
15 println!("B {allocator:?}");
16 let (ptr1, size1) = allocator.allocate_type::<[u8; 4096]>().unwrap();
17 println!("C {allocator:?}");
18 let (ptr2, size2) = allocator.allocate_type::<[u8; 4096 * 3 - 100]>().unwrap();
19 println!("D {allocator:?}");
20
21 assert_eq!(4096, size0);
22 assert_eq!(4096, size1);
23 assert_eq!(4096 * 3, size2);
24
25 println!();
26 println!("{allocator:?}");
27 allocator.deallocate(ptr0, size0);
28 println!("{allocator:?}");
29 allocator.deallocate(ptr1, size1);
30 println!("{allocator:?}");
31 allocator.deallocate(ptr2, size2);
32 println!("{allocator:?}");
33}More examples
examples/bench.rs (line 64)
20fn main() -> Result<(), BuddyError> {
21 let mut allocator = Allocator::<12>::new();
22 let ptr = NonNull::new(unsafe { MEMORY.as_mut_ptr() }).unwrap();
23 let len = core::mem::size_of_val(unsafe { &MEMORY });
24 allocator.init(12, ptr);
25 println!(
26 "MEMORY: {:#x}..{:#x}",
27 ptr.as_ptr() as usize,
28 ptr.as_ptr() as usize + len
29 );
30 let t = Instant::now();
31 unsafe { allocator.transfer(ptr, len) };
32 println!("transfer {:?}", t.elapsed());
33
34 assert_eq!(len, allocator.capacity());
35 assert_eq!(len, allocator.free());
36
37 println!(
38 "
39BEFORE
40{allocator:#x?}"
41 );
42
43 let mut blocks = [null_mut::<Page>(); 65536];
44 let layout = Layout::new::<Page>();
45 let t = Instant::now();
46 for block in blocks.iter_mut() {
47 let (ptr, size) = allocator.allocate_type::<Page>()?;
48 debug_assert_eq!(layout.size(), size);
49 *block = ptr.as_ptr();
50 }
51 let ta = t.elapsed();
52
53 println!(
54 "
55EMPTY
56{allocator:#x?}"
57 );
58
59 assert_eq!(len, allocator.capacity());
60 assert_eq!(len - blocks.len() * layout.size(), allocator.free());
61
62 let t = Instant::now();
63 for block in blocks.iter_mut() {
64 allocator.deallocate(NonNull::new(*block).unwrap(), layout.size());
65 *block = null_mut();
66 }
67 let td = t.elapsed();
68
69 assert_eq!(len, allocator.capacity());
70 assert_eq!(len, allocator.free());
71
72 println!(
73 "
74AFTER
75{allocator:#x?}"
76 );
77
78 println!(
79 "allocate {:?} ({} times)",
80 ta / blocks.len() as u32,
81 blocks.len()
82 );
83 println!(
84 "deallocate {:?} ({} times)",
85 td / blocks.len() as u32,
86 blocks.len()
87 );
88
89 Ok(())
90}Trait Implementations§
Source§impl<const N: usize, O: OligarchyCollection + Debug, B: BuddyCollection + Debug> Debug for BuddyAllocator<N, O, B>
impl<const N: usize, O: OligarchyCollection + Debug, B: BuddyCollection + Debug> Debug for BuddyAllocator<N, O, B>
Auto Trait Implementations§
impl<const N: usize, O, B> Freeze for BuddyAllocator<N, O, B>
impl<const N: usize, O, B> RefUnwindSafe for BuddyAllocator<N, O, B>where
O: RefUnwindSafe,
B: RefUnwindSafe,
impl<const N: usize, O, B> Send for BuddyAllocator<N, O, B>
impl<const N: usize, O, B> Sync for BuddyAllocator<N, O, B>
impl<const N: usize, O, B> Unpin for BuddyAllocator<N, O, B>
impl<const N: usize, O, B> UnwindSafe for BuddyAllocator<N, O, B>where
O: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more