Skip to content

Commit 0b673b4

Browse files
committed
Feature gate arena in extended
1 parent 4f5a813 commit 0b673b4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libmimalloc-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ debug = []
3131
debug_in_debug = []
3232
override = []
3333
extended = ["cty"]
34+
arena = []
3435
local_dynamic_tls = []
3536

3637
# Show `extended` on docs.rs since it's the full API surface.

libmimalloc-sys/src/extended.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ pub type mi_error_fun = Option<unsafe extern "C" fn(code: c_int, arg: *mut c_voi
465465
/// Runtime options. All options are false by default.
466466
pub type mi_option_t = c_int;
467467

468+
#[cfg(feature = "arena")]
468469
/// Arena Id
469470
pub type mi_arena_id_t = c_int;
470471

@@ -945,9 +946,11 @@ extern "C" {
945946
arg: *mut c_void,
946947
) -> bool;
947948

949+
#[cfg(feature = "arena")]
948950
/// Create a heap that only allocates in the specified arena
949951
pub fn mi_heap_new_in_arena(arena_id: mi_arena_id_t) -> *mut mi_heap_t;
950952

953+
#[cfg(feature = "arena")]
951954
/// Reserve OS memory for use by mimalloc. Reserved areas are used
952955
/// before allocating from the OS again. By reserving a large area upfront,
953956
/// allocation can be more efficient, and can be better managed on systems
@@ -968,6 +971,7 @@ extern "C" {
968971
arena_id: *mut mi_arena_id_t,
969972
) -> c_int;
970973

974+
#[cfg(feature = "arena")]
971975
/// Manage a particular memory area for use by mimalloc.
972976
/// This is just like `mi_reserve_os_memory_ex` except that the area should already be
973977
/// allocated in some manner and available for use my mimalloc.

0 commit comments

Comments
 (0)