2018-12-06 23:02:44 -05:00
|
|
|
use qadapt::no_alloc;
|
2018-11-18 21:29:32 -05:00
|
|
|
use qadapt::QADAPT;
|
|
|
|
|
|
|
|
#[global_allocator]
|
|
|
|
static Q: QADAPT = QADAPT;
|
|
|
|
|
2018-12-06 23:02:44 -05:00
|
|
|
#[no_alloc]
|
2018-11-18 21:29:32 -05:00
|
|
|
fn does_allocate() -> Box<u8> {
|
|
|
|
Box::new(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// If you were to run `cargo run --example release_mode`, this program blows up.
|
|
|
|
// If, however, you ran `cargo run --release --example release_mode`,
|
2018-11-22 11:19:31 -05:00
|
|
|
// nothing interesting will happen since panic-related code is stripped
|
|
|
|
// for release builds.
|
2018-11-18 21:29:32 -05:00
|
|
|
does_allocate();
|
|
|
|
}
|