@@ -48,11 +48,11 @@ This crate provides following cargo feature flags:
4848* ` stats ` (configure ` jemalloc ` with ` --enable-stats ` ): Enable statistics
4949 gathering functionality. See the ` jemalloc ` 's "` opt.stats_print ` " option
5050 documentation for usage details.
51-
51+
5252* ` debug ` (configure ` jemalloc ` with ` --enable-debug ` ): Enable assertions and
5353 validation code. This incurs a substantial performance hit, but is very useful
5454 during application development.
55-
55+
5656* ` background_threads_runtime_support ` (enabled by default): enables
5757 background-threads run-time support when building ` jemalloc-sys ` on some POSIX
5858 targets supported by ` jemalloc ` . Background threads are disabled at run-time
@@ -72,16 +72,25 @@ This crate provides following cargo feature flags:
7272* ` unprefixed_malloc_on_supported_platforms ` : when disabled, configure
7373 ` jemalloc ` with ` --with-jemalloc-prefix=_rjem_ ` . Enabling this causes symbols
7474 like ` malloc ` to be emitted without a prefix, overriding the ones defined by
75- libc. This usually causes C and C++ code linked in the same program to use
76- ` jemalloc ` as well. On some platforms prefixes are always used because
77- unprefixing is known to cause segfaults due to allocator mismatches.
78-
75+ libc. This usually causes C, Objective-C and C++ code linked in the same
76+ program to use ` jemalloc ` as well. On some platforms prefixes are always used
77+ because unprefixing is known to cause segfaults due to allocator mismatches.
78+
79+ Note that to use this, the ` jemalloc-sys ` crate must actually be visible to
80+ ` rustc ` (it is not enough to only declare it in ` Cargo.toml ` ). This can be
81+ done by adding:
82+ ``` rust
83+ use jemalloc_sys as _;
84+ ```
85+
86+ In your ` main.rs ` .
87+
7988* ` disable_initial_exec_tls ` (disabled by default): when enabled, jemalloc is
80- built with the ` --disable-initial-exec-tls ` option. It disables the
81- initial-exec TLS model for jemalloc's internal thread-local storage (on those
82- platforms that support explicit settings). This can allow jemalloc to be
89+ built with the ` --disable-initial-exec-tls ` option. It disables the
90+ initial-exec TLS model for jemalloc's internal thread-local storage (on those
91+ platforms that support explicit settings). This can allow jemalloc to be
8392 dynamically loaded after program startup (e.g. using dlopen). If you encounter
84- the error ` yourlib.so: cannot allocate memory in static TLS block ` , you'll
93+ the error ` yourlib.so: cannot allocate memory in static TLS block ` , you'll
8594 likely want to enable this.
8695
8796* ` disable_cache_oblivious ` (disabled by default): when enabled, jemalloc is
@@ -104,7 +113,7 @@ hyphens `-` are replaced with underscores `_`(see
104113 variable, the ` /etc/malloc.conf ` symlink, and the ` MALLOC_CONF ` environment
105114 variable (note: this variable might be prefixed as ` _RJEM_MALLOC_CONF ` ). For
106115 example, to change the default decay time for dirty pages to 30 seconds:
107-
116+
108117 ```
109118 JEMALLOC_SYS_WITH_MALLOC_CONF=dirty_decay_ms:30000
110119 ```
@@ -115,17 +124,17 @@ hyphens `-` are replaced with underscores `_`(see
115124 allocator page size equal to the system page size, so this option need not be
116125 specified unless the system page size may change between configuration and
117126 execution, e.g. when cross compiling.
118-
127+
119128* ` JEMALLOC_SYS_WITH_LG_HUGEPAGE=<lg-hugepage> ` : Specify the base 2 log of the
120129 system huge page size. This option is useful when cross compiling, or when
121130 overriding the default for systems that do not explicitly support huge pages.
122-
123-
131+
132+
124133* ` JEMALLOC_SYS_WITH_LG_QUANTUM=<lg-quantum> ` : Specify the base 2 log of the
125134 minimum allocation alignment. jemalloc needs to know the minimum alignment
126135 that meets the following C standard requirement (quoted from the April 12,
127136 2011 draft of the C11 standard):
128-
137+
129138 > The pointer returned if the allocation succeeds is suitably aligned so that
130139 > it may be assigned to a pointer to any type of object with a fundamental
131140 > alignment requirement and then used to access such an object or an array of
0 commit comments