rust/tests/ui/allocator/auxiliary/custom-as-global.rs

17 lines
266 B
Rust
Raw Normal View History

// no-prefer-dynamic
#![crate_type = "rlib"]
extern crate custom;
2019-01-26 10:14:49 -06:00
use std::sync::atomic::{AtomicUsize, Ordering};
use custom::A;
#[global_allocator]
2019-01-26 10:14:49 -06:00
static ALLOCATOR: A = A(AtomicUsize::new(0));
pub fn get() -> usize {
ALLOCATOR.0.load(Ordering::SeqCst)
}