summaryrefslogtreecommitdiffstats
path: root/src/test/ui/allocator/auxiliary/custom-as-global.rs
blob: a5e96e7750184a5e1e4bd0e3dd6891f858ae2db0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// no-prefer-dynamic

#![crate_type = "rlib"]

extern crate custom;

use std::sync::atomic::{AtomicUsize, Ordering};

use custom::A;

#[global_allocator]
static ALLOCATOR: A = A(AtomicUsize::new(0));

pub fn get() -> usize {
    ALLOCATOR.0.load(Ordering::SeqCst)
}