Skip to content

Commit

Permalink
Adapt to retyping of HEAP_START_ADDRESS from usize to u64
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Oct 13, 2021
1 parent dc7f6be commit 18543cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/rust/custom-heap/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ struct BumpAllocator;
unsafe impl std::alloc::GlobalAlloc for BumpAllocator {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
const POS_PTR: *mut usize = HEAP_START_ADDRESS as *mut usize;
const TOP_ADDRESS: usize = HEAP_START_ADDRESS + HEAP_LENGTH;
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS + size_of::<*mut u8>();
const POS_PTR: *mut usize = HEAP_START_ADDRESS as usize as *mut usize;
const TOP_ADDRESS: usize = HEAP_START_ADDRESS as usize + HEAP_LENGTH;
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS as usize + size_of::<*mut u8>();

let mut pos = *POS_PTR;
if pos == 0 {
Expand Down

0 comments on commit 18543cf

Please sign in to comment.