File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
### Added
6
6
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
9
9
10
10
### Changed
11
11
### Fixed
Original file line number Diff line number Diff line change @@ -250,17 +250,17 @@ mod tests {
250
250
fn test_tree_allocate_address_free_and_realloc ( ) {
251
251
let mut pool = AddressAllocator :: new ( 0x1000 , 0x1000 ) . unwrap ( ) ;
252
252
assert_eq ! ( pool. available( ) , 0x1000 ) ;
253
-
253
+ // Allocate 0x800
254
254
assert_eq ! (
255
255
pool. allocate( 0x800 , 0x100 , AllocPolicy :: FirstMatch )
256
256
. unwrap( ) ,
257
257
RangeInclusive :: new( 0x1000 , 0x17FF ) . unwrap( )
258
258
) ;
259
259
assert_eq ! ( pool. available( ) , 0x1000 - 0x800 ) ;
260
-
260
+ // Free 0x800
261
261
let _ = pool. free ( & RangeInclusive :: new ( 0x1000 , 0x17FF ) . unwrap ( ) ) ;
262
262
assert_eq ! ( pool. available( ) , 0x1000 ) ;
263
-
263
+ // Allocate 0x800 again
264
264
assert_eq ! (
265
265
pool. allocate( 0x800 , 0x100 , AllocPolicy :: FirstMatch )
266
266
. unwrap( ) ,
You can’t perform that action at this time.
0 commit comments