From 0850bc514737a64dc8ca13de8510fcad4756616a Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Wed, 27 Apr 2016 18:25:19 -0700 Subject: [PATCH] Fix build on machines without jemalloc Summary: It looks like we mistakenly enable JEMALLOC even if it's not available on the machine, that's why travis is failing Test Plan: check on my devserver check on my mac Reviewers: sdong Reviewed By: sdong Subscribers: andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D57345 --- build_tools/build_detect_platform | 2 +- build_tools/fbcode_config.sh | 1 + build_tools/fbcode_config4.8.1.sh | 1 + db/db_impl.cc | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index d07e01fed2..3c8c054728 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -453,6 +453,6 @@ echo "ROCKSDB_PATCH=$ROCKSDB_PATCH" >> "$OUTPUT" echo "CLANG_SCAN_BUILD=$CLANG_SCAN_BUILD" >> "$OUTPUT" echo "CLANG_ANALYZER=$CLANG_ANALYZER" >> "$OUTPUT" echo "PROFILING_FLAGS=$PROFILING_FLAGS" >> "$OUTPUT" -if test -z "$JEMALLOC"; then +if test -n "$JEMALLOC"; then echo "JEMALLOC=1" >> "$OUTPUT" fi diff --git a/build_tools/fbcode_config.sh b/build_tools/fbcode_config.sh index 9e1c613ecd..404f6e9116 100644 --- a/build_tools/fbcode_config.sh +++ b/build_tools/fbcode_config.sh @@ -61,6 +61,7 @@ CFLAGS+=" -DGFLAGS=google" # location of jemalloc JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include/" JEMALLOC_LIB=" $JEMALLOC_BASE/lib/libjemalloc.a" +JEMALLOC=1 if test -z $PIC_BUILD; then # location of numa diff --git a/build_tools/fbcode_config4.8.1.sh b/build_tools/fbcode_config4.8.1.sh index 71428d03b7..dbda429c5c 100644 --- a/build_tools/fbcode_config4.8.1.sh +++ b/build_tools/fbcode_config4.8.1.sh @@ -40,6 +40,7 @@ GFLAGS_LIBS=" $GFLAGS_BASE/lib/libgflags.a" # location of jemalloc JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include" JEMALLOC_LIB="$JEMALLOC_BASE/lib/libjemalloc.a" +JEMALLOC=1 # location of numa NUMA_INCLUDE=" -I $NUMA_BASE/include/" diff --git a/db/db_impl.cc b/db/db_impl.cc index a27a8c06a1..ff4c44721a 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -536,6 +536,7 @@ void DBImpl::PrintStatistics() { } } +#ifndef ROCKSDB_LITE #ifdef ROCKSDB_JEMALLOC typedef struct { char* cur; @@ -566,6 +567,7 @@ static void DumpMallocStats(std::string* stats) { stats->append(buf.get()); #endif // ROCKSDB_JEMALLOC } +#endif // !ROCKSDB_LITE void DBImpl::MaybeDumpStats() { if (db_options_.stats_dump_period_sec == 0) return;