File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 44
55### Added
66
7- - Added ` available() ` API in ` AddressAllocator ` to allow getting the
8- available memories after ` allocate/free() ` s
7+ - Added ` available() ` API in ` AddressAllocator ` to allow
8+ getting the available memories after ` allocate/free() ` s
99
1010### Changed
1111### Fixed
Original file line number Diff line number Diff line change @@ -250,17 +250,17 @@ mod tests {
250250 fn test_tree_allocate_address_free_and_realloc ( ) {
251251 let mut pool = AddressAllocator :: new ( 0x1000 , 0x1000 ) . unwrap ( ) ;
252252 assert_eq ! ( pool. available( ) , 0x1000 ) ;
253-
253+ // Allocate 0x800
254254 assert_eq ! (
255255 pool. allocate( 0x800 , 0x100 , AllocPolicy :: FirstMatch )
256256 . unwrap( ) ,
257257 RangeInclusive :: new( 0x1000 , 0x17FF ) . unwrap( )
258258 ) ;
259259 assert_eq ! ( pool. available( ) , 0x1000 - 0x800 ) ;
260-
260+ // Free 0x800
261261 let _ = pool. free ( & RangeInclusive :: new ( 0x1000 , 0x17FF ) . unwrap ( ) ) ;
262262 assert_eq ! ( pool. available( ) , 0x1000 ) ;
263-
263+ // Allocate 0x800 again
264264 assert_eq ! (
265265 pool. allocate( 0x800 , 0x100 , AllocPolicy :: FirstMatch )
266266 . unwrap( ) ,
You can’t perform that action at this time.
0 commit comments