File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 10
10
11
11
use core:: alloc:: { GlobalAlloc , Layout } ;
12
12
use core:: cell:: RefCell ;
13
- use core:: ptr:: NonNull ;
13
+ use core:: ptr:: { self , NonNull } ;
14
14
15
15
use cortex_m:: interrupt:: Mutex ;
16
16
use linked_list_allocator:: Heap ;
@@ -47,7 +47,7 @@ impl CortexMHeap {
47
47
/// - The size of the heap is `(end_addr as usize) - (start_addr as usize)`. The
48
48
/// allocator won't use the byte at `end_addr`.
49
49
///
50
- /// # Unsafety
50
+ /// # Safety
51
51
///
52
52
/// Obey these or Bad Stuff will happen.
53
53
///
@@ -78,7 +78,7 @@ unsafe impl GlobalAlloc for CortexMHeap {
78
78
. borrow_mut ( )
79
79
. allocate_first_fit ( layout)
80
80
. ok ( )
81
- . map_or ( 0 as * mut u8 , |allocation| allocation. as_ptr ( ) )
81
+ . map_or ( ptr :: null_mut ( ) , |allocation| allocation. as_ptr ( ) )
82
82
} )
83
83
}
84
84
You can’t perform that action at this time.
0 commit comments