File tree 3 files changed +13
-0
lines changed
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ background_threads = [ "background_threads_runtime_support" ]
40
40
stats = []
41
41
unprefixed_malloc_on_supported_platforms = []
42
42
disable_initial_exec_tls = []
43
+ disable_cache_oblivious = []
43
44
44
45
[package .metadata .docs .rs ]
45
46
rustdoc-args = [ " --cfg" , " jemallocator_docs" ]
Original file line number Diff line number Diff line change @@ -84,6 +84,13 @@ This crate provides following cargo feature flags:
84
84
the error ` yourlib.so: cannot allocate memory in static TLS block ` , you'll
85
85
likely want to enable this.
86
86
87
+ * ` disable_cache_oblivious ` (disabled by default): when enabled, jemalloc is
88
+ built with the ` --disable-cache-oblivious ` option. In that case, all large
89
+ allocations are page-aligned as an implementation artifact. It may severely
90
+ harm CPU cache utilization. However, the cache-oblivious layout has a cost of
91
+ one extra page per large allocation which can be unfeasible for certain
92
+ applications.
93
+
87
94
### Environment variables
88
95
89
96
` jemalloc ` options taking values are passed via environment variables using the
Original file line number Diff line number Diff line change @@ -262,6 +262,11 @@ fn main() {
262
262
cmd. arg ( "--disable-initial-exec-tls" ) ;
263
263
}
264
264
265
+ if env:: var ( "CARGO_FEATURE_DISABLE_CACHE_OBLIVIOUS" ) . is_ok ( ) {
266
+ info ! ( "CARGO_FEATURE_DISABLE_CACHE_OBLIVIOUS set" ) ;
267
+ cmd. arg ( "--disable-cache-oblivious" ) ;
268
+ }
269
+
265
270
cmd. arg ( format ! ( "--host={}" , gnu_target( & target) ) ) ;
266
271
cmd. arg ( format ! ( "--build={}" , gnu_target( & host) ) ) ;
267
272
cmd. arg ( format ! ( "--prefix={}" , out_dir. display( ) ) ) ;
You can’t perform that action at this time.
0 commit comments