Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 18543cf

Browse files
committed
Adapt to retyping of HEAP_START_ADDRESS from usize to u64
1 parent dc7f6be commit 18543cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/rust/custom-heap/src/entrypoint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ struct BumpAllocator;
1717
unsafe impl std::alloc::GlobalAlloc for BumpAllocator {
1818
#[inline]
1919
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
20-
const POS_PTR: *mut usize = HEAP_START_ADDRESS as *mut usize;
21-
const TOP_ADDRESS: usize = HEAP_START_ADDRESS + HEAP_LENGTH;
22-
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS + size_of::<*mut u8>();
20+
const POS_PTR: *mut usize = HEAP_START_ADDRESS as usize as *mut usize;
21+
const TOP_ADDRESS: usize = HEAP_START_ADDRESS as usize + HEAP_LENGTH;
22+
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS as usize + size_of::<*mut u8>();
2323

2424
let mut pos = *POS_PTR;
2525
if pos == 0 {

0 commit comments

Comments
 (0)