rust/src/test/run-pass/allocator/auxiliary/custom-as-global.rs

17 lines
270 B
Rust
Raw Normal View History

// no-prefer-dynamic
#![crate_type = "rlib"]
extern crate custom;
use std::sync::atomic::{ATOMIC_USIZE_INIT, Ordering};
use custom::A;
#[global_allocator]
static ALLOCATOR: A = A(ATOMIC_USIZE_INIT);
pub fn get() -> usize {
ALLOCATOR.0.load(Ordering::SeqCst)
}