1
0
mirror of https://github.com/bspeice/qadapt synced 2025-07-01 22:06:49 -04:00

Renaming and a new macro

This commit is contained in:
2018-12-06 23:02:44 -05:00
parent a1ee8934b4
commit 65673e1af2
8 changed files with 164 additions and 63 deletions

View File

@ -1,10 +1,10 @@
use qadapt::allocate_panic;
use qadapt::no_alloc;
use qadapt::QADAPT;
#[global_allocator]
static Q: QADAPT = QADAPT;
#[allocate_panic]
#[no_alloc]
fn does_allocate() -> Box<u8> {
Box::new(0)
}

View File

@ -1,20 +0,0 @@
use env_logger;
use qadapt::allocate_panic;
// Note that we're missing the `#[global_allocator]` attribute
#[allocate_panic]
fn does_allocate() -> Box<u8> {
Box::new(0)
}
fn main() {
// This code will warn that QADAPT isn't being used, but won't trigger a panic.
// Run with `RUST_LOG=warn cargo run --example setup_warning`
env_logger::init();
does_allocate();
// The warning will only trigger once though
does_allocate();
}