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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
266 B
Rust
Raw Normal View History

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