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