From 4a13d52faf0801a0f4b4e51ea65e229b7e3e5c61 Mon Sep 17 00:00:00 2001 From: jmaargh Date: Mon, 16 Oct 2023 22:50:53 +0100 Subject: [PATCH] Resolve TODOs about linker symbols --- 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 53f3d5f8..2a16b7ac 100644 --- a/agb/src/agb_alloc/mod.rs +++ b/agb/src/agb_alloc/mod.rs @@ -129,8 +129,8 @@ fn iwram_data_end() -> usize { static __iwram_end: usize; } - // TODO: This seems completely wrong, but without the &, rust generates - // a double dereference :/. Maybe a bug in nightly? + // 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 } @@ -139,8 +139,8 @@ fn data_end() -> usize { static __ewram_data_end: usize; } - // TODO: This seems completely wrong, but without the &, rust generates - // a double dereference :/. Maybe a bug in nightly? + // 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 }