Skip to content

Commit 1936c8b

Browse files
committed
fix extended build
1 parent df231c8 commit 1936c8b

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

libmimalloc-sys/src/extended.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,9 @@ pub const mi_option_reserve_huge_os_pages_at: mi_option_t = 8;
525525
pub const mi_option_reserve_os_memory: mi_option_t = 9;
526526

527527
/// Option (experimental) the first N segments per thread are not eagerly committed (=1).
528+
///
529+
/// Note: removed/renamed in v3 (`mi_option_deprecated_eager_commit_delay`).
530+
#[cfg(not(feature = "v3"))]
528531
pub const mi_option_eager_commit_delay: mi_option_t = 14;
529532

530533
/// Option (experimental) Pretend there are at most N NUMA nodes; Use 0 to use the actual detected NUMA nodes at runtime.
@@ -965,12 +968,34 @@ extern "C" {
965968
/// Returns `true` if all areas and blocks were visited.
966969
///
967970
/// Passing a `None` visitor is allowed, and is a no-op.
971+
#[cfg(not(feature = "v3"))]
968972
pub fn mi_heap_visit_blocks(
969973
heap: *const mi_heap_t,
970974
visit_all_blocks: bool,
971975
visitor: mi_block_visit_fun,
972976
arg: *mut c_void,
973977
) -> bool;
978+
/// Visit all areas and blocks in `heap`.
979+
///
980+
/// If `visit_all_blocks` is false, the `visitor` is only called once for
981+
/// every heap area. If it's true, the `visitor` is also called for every
982+
/// allocated block inside every area (with `!block.is_null()`). Return
983+
/// `false` from the `visitor` to return early.
984+
///
985+
/// `arg` is an extra argument passed into the `visitor`.
986+
///
987+
/// Returns `true` if all areas and blocks were visited.
988+
///
989+
/// Passing a `None` visitor is allowed, and is a no-op.
990+
///
991+
/// Note: in v3 the `heap` parameter is non-const compared to v2.
992+
#[cfg(feature = "v3")]
993+
pub fn mi_heap_visit_blocks(
994+
heap: *mut mi_heap_t,
995+
visit_all_blocks: bool,
996+
visitor: mi_block_visit_fun,
997+
arg: *mut c_void,
998+
) -> bool;
974999

9751000
#[cfg(feature = "arena")]
9761001
/// Create a heap that only allocates in the specified arena

0 commit comments

Comments
 (0)