File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ pub struct AddressAllocator {
29
29
// tree will represent a memory location and can have two states either
30
30
// `NodeState::Free` or `NodeState::Allocated`.
31
31
interval_tree : IntervalTree ,
32
- // Available memory space
32
+ // Available free memory space in the address space.
33
+ // NOTE that due to fragmentations, |available| may not give the actual
34
+ // available (contiguous) memory block that can be allocated in next
35
+ // allocate() call.
33
36
available : usize ,
34
37
}
35
38
@@ -80,6 +83,9 @@ impl AddressAllocator {
80
83
}
81
84
82
85
/// Returns the available memory size in this allocator.
86
+ /// NOTE that due to fragmentations, it's not guaranteed that the next
87
+ /// allocate() call after querying the available memory can succeed with
88
+ /// allocating those available memories and it may still return OOM.
83
89
pub fn available ( & self ) -> usize {
84
90
self . available
85
91
}
You can’t perform that action at this time.
0 commit comments