Skip to content

Commit ec6b98d

Browse files
committed
Remove broken experimental extended mode definitions + remove secure mode as default feature
1 parent 934a2fb commit ec6b98d

File tree

4 files changed

+5
-110
lines changed

4 files changed

+5
-110
lines changed

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ travis-ci = { repository = "purpleprotocol/mimalloc_rust" }
2424
libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.33", default-features = false }
2525

2626
[features]
27-
default = ["secure"]
27+
default = []
2828
secure = ["libmimalloc-sys/secure"]
2929
override = ["libmimalloc-sys/override"]
3030
debug = ["libmimalloc-sys/debug"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mimalloc Rust
22

3-
[![Build Status](https://travis-ci.org/purpleprotocol/mimalloc_rust.svg?branch=master)](https://travis-ci.org/purpleprotocol/mimalloc_rust) [![Latest Version]][crates.io] [![Documentation]][docs.rs]
3+
[![Latest Version]][crates.io] [![Documentation]][docs.rs]
44

55
A drop-in global allocator wrapper around the [mimalloc](https://github.com/microsoft/mimalloc) allocator.
66
Mimalloc is a general purpose, performance oriented allocator built by Microsoft.
@@ -18,9 +18,9 @@ static GLOBAL: MiMalloc = MiMalloc;
1818

1919
A __C__ compiler is required for building [mimalloc](https://github.com/microsoft/mimalloc) with cargo.
2020

21-
## Usage without secure mode
21+
## Usage with secure mode
2222

23-
By default this library builds mimalloc in secure mode. This add guard pages,
23+
Using secure mode adds guard pages,
2424
randomized allocation, encrypted free lists, etc. The performance penalty is usually
2525
around 10% according to [mimalloc](https://github.com/microsoft/mimalloc)
2626
own benchmarks.
@@ -29,7 +29,7 @@ To disable secure mode, put in `Cargo.toml`:
2929

3030
```ini
3131
[dependencies]
32-
mimalloc = { version = "*", default-features = false }
32+
mimalloc = { version = "*", features = ["secure"] }
3333
```
3434

3535
[crates.io]: https://crates.io/crates/mimalloc

libmimalloc-sys/src/extended.rs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -479,15 +479,6 @@ pub const mi_option_show_stats: mi_option_t = 1;
479479
pub const mi_option_verbose: mi_option_t = 2;
480480

481481
/// ### The following options are experimental
482-
/// ### Deprecated options are kept for binary backward compatibility with v1.x versions
483-
484-
/// Option (experimental) Eagerly commit segments (4MiB) (enabled by default).
485-
pub const mi_option_eager_commit: mi_option_t = 3;
486-
487-
/// Option Deprecated
488-
pub const mi_option_deprecated_eager_region_commit: mi_option_t = 4;
489-
/// Option Deprecated
490-
pub const mi_option_deprecated_reset_decommits: mi_option_t = 5;
491482
492483
/// Option (experimental) Use large OS pages (2MiB in size) if possible.
493484
///
@@ -524,33 +515,9 @@ pub const mi_option_reserve_huge_os_pages_at: mi_option_t = 8;
524515
/// Option (experimental) Reserve specified amount of OS memory at startup, e.g. "1g" or "512m".
525516
pub const mi_option_reserve_os_memory: mi_option_t = 9;
526517

527-
/// Option Deprecated
528-
pub const mi_option_deprecated_segment_cache: mi_option_t = 10;
529-
530-
/// Option (experimental) Reset page memory after a mi_option_reset_delay milliseconds when it becomes free.
531-
///
532-
/// By default, mimalloc will reset (or purge) OS pages that are not in use, to signal to the OS
533-
/// that the underlying physical memory can be reused. This can reduce memory fragmentation in
534-
/// long running (server) programs. By setting it to 0 this will no longer be done which can improve
535-
/// performance for batch-like programs. As an alternative, the mi_option_reset_delay= can be set
536-
/// higher (100ms by default) to make the page reset occur less frequently instead of turning it
537-
/// off completely.
538-
///
539-
/// Default: 1 (true)
540-
pub const mi_option_page_reset: mi_option_t = 11;
541-
542-
/// Option (experimental)
543-
pub const mi_option_abandoned_page_decommit: mi_option_t = 12;
544-
545-
// Option (experimental)
546-
pub const mi_option_deprecated_segment_reset: mi_option_t = 13;
547-
548518
/// Option (experimental) the first N segments per thread are not eagerly committed (=1).
549519
pub const mi_option_eager_commit_delay: mi_option_t = 14;
550520

551-
/// Option (experimental) Decommit page memory after N milli-seconds delay (25ms).
552-
pub const mi_option_decommit_delay: mi_option_t = 15;
553-
554521
/// Option (experimental) Pretend there are at most N NUMA nodes; Use 0 to use the actual detected NUMA nodes at runtime.
555522
pub const mi_option_use_numa_nodes: mi_option_t = 16;
556523

@@ -569,15 +536,6 @@ pub const mi_option_max_warnings: mi_option_t = 20;
569536
/// Option (experimental)
570537
pub const mi_option_max_segment_reclaim: mi_option_t = 21;
571538

572-
/// Option (experimental) Enable decommitting memory (=on)
573-
pub const mi_option_allow_decommit: mi_option_t = 22;
574-
575-
/// Option (experimental) Decommit large segment memory after N milli-seconds delay (500ms).
576-
pub const mi_option_segment_decommit_delay: mi_option_t = 23;
577-
578-
/// Option (experimental)
579-
pub const mi_option_decommit_extend_delay: mi_option_t = 24;
580-
581539
/// Last option.
582540
pub const _mi_option_last: mi_option_t = 26;
583541

@@ -989,21 +947,6 @@ extern "C" {
989947
mod tests {
990948
use super::*;
991949

992-
#[test]
993-
fn runtime_option_decommit() {
994-
unsafe {
995-
// decommit slices when no longer used (after decommit_delay milli-seconds) (default 1)
996-
assert_eq!(mi_option_get(mi_option_allow_decommit), 1);
997-
mi_option_set(mi_option_allow_decommit, 0);
998-
assert_eq!(mi_option_get(mi_option_allow_decommit), 0);
999-
1000-
// page decommit delay in milli-seconds (default 25)
1001-
assert_eq!(mi_option_get(mi_option_decommit_delay), 25);
1002-
mi_option_set(mi_option_decommit_delay, 100);
1003-
assert_eq!(mi_option_get(mi_option_decommit_delay), 100);
1004-
}
1005-
}
1006-
1007950
#[test]
1008951
fn runtime_stable_option() {
1009952
unsafe {

0 commit comments

Comments
 (0)