@@ -18,7 +18,7 @@ pub struct Allocation {
18
18
pub size : NonZero < Size > ,
19
19
}
20
20
21
- /// A super simple fast soft-realtime allocator for managing an external pool
21
+ /// A super- simple fast soft-realtime allocator for managing an external pool
22
22
/// of memory
23
23
///
24
24
/// Since the pool of memory it manages is external, it could be useful as a
@@ -35,7 +35,7 @@ pub struct Allocation {
35
35
/// ~100,000 separate free-regions, a worst-case lookup will traverse only 5
36
36
/// tree nodes.
37
37
#[ derive( Clone ) ]
38
- pub struct OrderlyAllocator {
38
+ pub struct Allocator {
39
39
/// An ordered collection of free-regions, sorted primarily by size, then by
40
40
/// location
41
41
free : BTreeSet < FreeRegion > ,
@@ -74,15 +74,15 @@ impl Ord for FreeRegion {
74
74
}
75
75
}
76
76
77
- impl OrderlyAllocator {
77
+ impl Allocator {
78
78
/// Create a new allocator to manage a pool of memory
79
79
///
80
80
/// Panics:
81
81
/// - Panics if `capacity == 0`
82
82
pub fn new ( capacity : Size ) -> Self {
83
83
let capacity = NonZero :: new ( capacity) . expect ( "`capacity == 0`" ) ;
84
84
85
- let mut allocator = OrderlyAllocator {
85
+ let mut allocator = Allocator {
86
86
free : BTreeSet :: new ( ) ,
87
87
location_map : BTreeMap :: new ( ) ,
88
88
capacity,
@@ -290,9 +290,9 @@ impl OrderlyAllocator {
290
290
}
291
291
}
292
292
293
- impl fmt:: Debug for OrderlyAllocator {
293
+ impl fmt:: Debug for Allocator {
294
294
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
295
- f. debug_struct ( "OrderlyAllocator " )
295
+ f. debug_struct ( "Allocator " )
296
296
. field ( & "capacity" , & self . capacity )
297
297
. field ( & "total_available" , & self . available )
298
298
. field ( & "largest_available" , & self . largest_available ( ) )
0 commit comments