[package] name = "malloc_utils" version = "0.1.0" authors = ["Paul Hauner "] edition = { workspace = true } # Features are not rich enough to express the complexity of our defaults, so we choose to just # use the jemalloc feature to control whether the dependency is compiled, but avoid using it if # the `sysmalloc` feature is set. # # On Windows, setting the jemalloc feature will result in a compile-time error. [features] default = [] mallinfo2 = [] # The jemalloc feature enables the compilation of jemalloc dependencies. Jemalloc is also the # default allocator, unless `sysmalloc` is set. # # It should be turned off on Windows. jemalloc = ["tikv-jemalloc-ctl", "tikv-jemallocator"] jemalloc-profiling = ["tikv-jemallocator/profiling"] # Force the use of system malloc (or glibc) rather than jemalloc. # This is a no-op on Windows where jemalloc is always disabled. sysmalloc = [] # Enable jemalloc with unprefixed malloc (recommended for reproducible builds) jemalloc-unprefixed = ["jemalloc", "tikv-jemallocator/unprefixed_malloc_on_supported_platforms"] [dependencies] libc = "0.2.79" metrics = { workspace = true } parking_lot = { workspace = true } tikv-jemalloc-ctl = { version = "0.6.0", optional = true, features = ["stats"] } [target.'cfg(not(target_os = "linux"))'.dependencies] tikv-jemallocator = { version = "0.6.0", optional = true, features = ["stats"] } # Jemalloc's background_threads feature requires Linux (pthreads). [target.'cfg(target_os = "linux")'.dependencies] tikv-jemallocator = { version = "0.6.0", optional = true, features = [ "stats", "background_threads", ] }