File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ pub struct AddressAllocator {
2929 // tree will represent a memory location and can have two states either
3030 // `NodeState::Free` or `NodeState::Allocated`.
3131 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.
3336 available : usize ,
3437}
3538
@@ -80,6 +83,9 @@ impl AddressAllocator {
8083 }
8184
8285 /// 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.
8389 pub fn available ( & self ) -> usize {
8490 self . available
8591 }
You can’t perform that action at this time.
0 commit comments