Get name of current used allocator in Rust program

Viewed 59

How can I write a Rust function:

fn current_allocator_name() -> &str { ... }

which will return name of current used allocator?


For example if my program use jemalloc:

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

Then this function will return string "jemalloc"

0 Answers
Related