mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Add allocation example
This commit is contained in:
parent
22189eb809
commit
469db77437
15
agb/examples/allocation.rs
Normal file
15
agb/examples/allocation.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
extern crate agb;
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
|
||||
#[agb::entry]
|
||||
fn main() -> ! {
|
||||
loop {
|
||||
let b = Box::new(1);
|
||||
agb::println!("dynamic allocation made to {:?}", &*b as *const _);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue