File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,19 @@ impl AddressAllocator {
67
67
) -> Result < RangeInclusive > {
68
68
let constraint = Constraint :: new ( size, alignment, policy) ?;
69
69
let allocated = self . interval_tree . allocate ( constraint) ?;
70
- self . used . checked_add ( allocated. len ( ) as usize ) . expect ( "Failed to calculate used memory" ) ;
70
+ self . used
71
+ . checked_add ( allocated. len ( ) as usize )
72
+ . expect ( "Failed to calculate used memory" ) ;
71
73
Ok ( allocated)
72
74
}
73
75
74
76
/// Deletes the specified memory slot or returns `ResourceNotAvailable` if
75
77
/// the node was not allocated before.
76
78
pub fn free ( & mut self , key : & RangeInclusive ) -> Result < ( ) > {
77
79
self . interval_tree . free ( key) ?;
78
- self . used . checked_sub ( key. len ( ) as usize ) . expect ( "Failed to calculate used memory" ) ;
80
+ self . used
81
+ . checked_sub ( key. len ( ) as usize )
82
+ . expect ( "Failed to calculate used memory" ) ;
79
83
Ok ( ( ) )
80
84
}
81
85
You can’t perform that action at this time.
0 commit comments