[][src]Function qadapt::is_active

pub fn is_active() -> bool
Deprecated since 1.0.3:

Please use the alloc_counter crate instead.

Determine whether QADAPT will trigger thread panics if an allocation happens during protected code. This should be used for making sure that QADAPT is properly set up and initialized.

Note that this will return false in release builds even if QADAPT is set as the #[global_allocator].

Example:

use qadapt::is_active;
use qadapt::QADAPT;

#[global_allocator]
static Q: QADAPT = QADAPT;

pub fn main() {
    assert!(is_active());
}