Support building RocksDB with jemalloc (#542)

master
Artem Krylysov 3 years ago committed by GitHub
parent cc3a2bec59
commit e6407ed405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .github/workflows/rust.yml
  2. 1
      Cargo.toml
  3. 2
      librocksdb-sys/Cargo.toml
  4. 4
      librocksdb-sys/build.rs

@ -99,3 +99,9 @@ jobs:
with:
command: test
args: --features multi-threaded-cf
- name: Run rocksdb tests (jemalloc)
if: runner.os != 'Windows'
uses: actions-rs/cargo@v1
with:
command: test
args: --features jemalloc

@ -18,6 +18,7 @@ exclude = [
[features]
default = ["snappy", "lz4", "zstd", "zlib", "bzip2"]
jemalloc = ["librocksdb-sys/jemalloc"]
valgrind = []
snappy = ["librocksdb-sys/snappy"]
lz4 = ["librocksdb-sys/lz4"]

@ -13,6 +13,7 @@ links = "rocksdb"
[features]
default = [ "static" ]
jemalloc = ["jemalloc-sys"]
static = []
snappy = []
lz4 = []
@ -22,6 +23,7 @@ bzip2 = []
[dependencies]
libc = "0.2"
jemalloc-sys = { version = "0.3", features = ["unprefixed_malloc_on_supported_platforms"], optional = true }
[dev-dependencies]
const-cstr = "0.3"

@ -187,6 +187,10 @@ fn build_rocksdb() {
config.define("ROCKSDB_SUPPORT_THREAD_LOCAL", None);
if cfg!(feature = "jemalloc") {
config.define("WITH_JEMALLOC", "ON");
}
if target.contains("msvc") {
config.flag("-EHsc");
} else {

Loading…
Cancel
Save