privatise agb_alloc crate

This commit is contained in:
Corwin 2022-07-30 19:34:30 +01:00
parent cd000ca767
commit feea7d2af1
2 changed files with 5 additions and 3 deletions

View file

@ -9,9 +9,9 @@ use alloc::boxed::Box;
#[agb::entry] #[agb::entry]
fn main(_gba: agb::Gba) -> ! { fn main(_gba: agb::Gba) -> ! {
loop { loop {
let a = Box::new_in(1, agb::agb_alloc::EWRAM_ALLOC); let a = Box::new_in(1, agb::EWRAM_ALLOC);
let b = Box::new(1); let b = Box::new(1);
let c = Box::new_in(3, agb::agb_alloc::IWRAM_ALLOC); let c = Box::new_in(3, agb::IWRAM_ALLOC);
agb::println!("ewram allocation made to {:?}", &*a as *const _); agb::println!("ewram allocation made to {:?}", &*a as *const _);
agb::println!("global allocation made to {:?}", &*b as *const _); agb::println!("global allocation made to {:?}", &*b as *const _);
agb::println!("iwram allocation made to {:?}", &*c as *const _); agb::println!("iwram allocation made to {:?}", &*c as *const _);

View file

@ -162,7 +162,7 @@ pub use agb_macros::entry;
pub use agb_sound_converter::include_wav; pub use agb_sound_converter::include_wav;
extern crate alloc; extern crate alloc;
pub mod agb_alloc; mod agb_alloc;
mod agbabi; mod agbabi;
mod bitarray; mod bitarray;
@ -190,6 +190,8 @@ pub mod syscall;
/// Interactions with the internal timers /// Interactions with the internal timers
pub mod timer; pub mod timer;
pub use {agb_alloc::EWRAM_ALLOC, agb_alloc::IWRAM_ALLOC};
#[cfg(not(any(test, feature = "testing")))] #[cfg(not(any(test, feature = "testing")))]
#[panic_handler] #[panic_handler]
#[allow(unused_must_use)] #[allow(unused_must_use)]