diff --git a/Cargo.toml b/Cargo.toml index 4b7dfe896..450accce5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,10 @@ exclude = [ [features] default = [] -valgrind = [] +jemalloc = ["librocksdb_sys/jemalloc"] portable = ["librocksdb_sys/portable"] sse = ["librocksdb_sys/sse"] +valgrind = [] [dependencies] libc = "0.2.11" diff --git a/librocksdb_sys/Cargo.toml b/librocksdb_sys/Cargo.toml index 4020f0b9d..7ce17c373 100644 --- a/librocksdb_sys/Cargo.toml +++ b/librocksdb_sys/Cargo.toml @@ -14,6 +14,7 @@ tempdir = "0.3" [features] default = [] +jemalloc = [] # portable doesn't require static link, though it's meaningless # when not using with static-link right now in this crate. portable = ["libtitan_sys/portable"] diff --git a/librocksdb_sys/build.rs b/librocksdb_sys/build.rs index e7886a4ea..3f76590c6 100644 --- a/librocksdb_sys/build.rs +++ b/librocksdb_sys/build.rs @@ -77,6 +77,9 @@ fn build_rocksdb() -> Build { } let mut cfg = Config::new("rocksdb"); + if cfg!(feature = "jemalloc") { + cfg.define("WITH_JEMALLOC", "ON"); + } if cfg!(feature = "portable") { cfg.define("PORTABLE", "ON"); }