From 8091e22b10fb55a87ecedabde145f07087a1c3cd Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 17 Oct 2023 22:09:15 +0100 Subject: [PATCH] use macro for the grabbing linker variable --- agb/src/agb_alloc/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agb/src/agb_alloc/mod.rs b/agb/src/agb_alloc/mod.rs index 2a16b7ac..617786b1 100644 --- a/agb/src/agb_alloc/mod.rs +++ b/agb/src/agb_alloc/mod.rs @@ -126,22 +126,22 @@ pub(crate) unsafe fn number_of_blocks() -> u32 { fn iwram_data_end() -> usize { extern "C" { - static __iwram_end: usize; + static __iwram_end: u8; } // Symbols defined in the linker have an address *but no data or value*. // As strange as this looks, they are only useful to take the address of. - (unsafe { &__iwram_end }) as *const _ as usize + unsafe { core::ptr::addr_of!(__iwram_end) as usize } } fn data_end() -> usize { extern "C" { - static __ewram_data_end: usize; + static __ewram_data_end: u8; } // Symbols defined in the linker have an address *but no data or value*. // As strange as this looks, they are only useful to take the address of. - (unsafe { &__ewram_data_end }) as *const _ as usize + unsafe { core::ptr::addr_of!(__ewram_data_end) as usize } } #[cfg(test)]