File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -51,26 +51,25 @@ impl Heap {
5151 once_flag. set ( true ) ;
5252
5353 self . heap
54- . borrow ( cs)
55- . borrow_mut ( )
54+ . borrow_ref_mut ( cs)
5655 . init ( start_addr as * mut u8 , size) ;
5756 } ) ;
5857 }
5958
6059 /// Returns an estimate of the amount of bytes in use.
6160 pub fn used ( & self ) -> usize {
62- critical_section:: with ( |cs| self . heap . borrow ( cs) . borrow ( ) . used ( ) )
61+ critical_section:: with ( |cs| self . heap . borrow_ref ( cs) . used ( ) )
6362 }
6463
6564 /// Returns an estimate of the amount of bytes available.
6665 pub fn free ( & self ) -> usize {
67- critical_section:: with ( |cs| self . heap . borrow ( cs) . borrow ( ) . free ( ) )
66+ critical_section:: with ( |cs| self . heap . borrow_ref ( cs) . free ( ) )
6867 }
6968}
7069
7170unsafe impl GlobalAlloc for Heap {
7271 unsafe fn alloc ( & self , layout : Layout ) -> * mut u8 {
73- critical_section:: with ( |cs| self . heap . borrow ( cs) . borrow_mut ( ) . alloc ( layout) )
72+ critical_section:: with ( |cs| self . heap . borrow_ref_mut ( cs) . alloc ( layout) )
7473 }
7574
7675 unsafe fn dealloc ( & self , _ptr : * mut u8 , _layout : Layout ) { }
You can’t perform that action at this time.
0 commit comments