File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,19 @@ impl AddressAllocator {
6767 ) -> Result < RangeInclusive > {
6868 let constraint = Constraint :: new ( size, alignment, policy) ?;
6969 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" ) ;
7173 Ok ( allocated)
7274 }
7375
7476 /// Deletes the specified memory slot or returns `ResourceNotAvailable` if
7577 /// the node was not allocated before.
7678 pub fn free ( & mut self , key : & RangeInclusive ) -> Result < ( ) > {
7779 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" ) ;
7983 Ok ( ( ) )
8084 }
8185
You can’t perform that action at this time.
0 commit comments