tg-geom 0.0.0

Rust bindings for the `TG` Geometry library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Custom memory allocator support.

use std::sync::Once;

static INIT: Once = Once::new();

/// Safe to call multiple times; only the first call has effect.
#[inline]
pub fn init_mimalloc() {
    INIT.call_once(|| unsafe {
        tg_geom_sys::tg_env_set_allocator(
            Some(libmimalloc_sys::mi_malloc),
            Some(libmimalloc_sys::mi_realloc),
            Some(libmimalloc_sys::mi_free),
        );
    });
}