Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build-bench-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,11 @@ if test "$setup_rocksdb" = "1"; then
fi

cd "rocksdb-$version_rocksdb"
# musl defines neither _POSIX_C_SOURCE nor _XOPEN_SOURCE by default, so
# without this rocksdb allocates its cache shards with plain malloc
set +e
patch -p1 -N -r- < ../../patches/rocksdb_cacheline_alloc.patch
set -e
DISABLE_WARNING_AS_ERROR=1 DISABLE_JEMALLOC=1 ROCKSDB_DISABLE_TCMALLOC=1 make db_bench -j $procs
[ "$CI" ] && find . -name '*.o' -delete
popd
Expand Down
11 changes: 11 additions & 0 deletions patches/rocksdb_cacheline_alloc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/port/port_posix.cc
+++ b/port/port_posix.cc
@@ -228,7 +228,7 @@
void* cacheline_aligned_alloc(size_t size) {
#if __GNUC__ < 5 && defined(__SANITIZE_ADDRESS__)
return malloc(size);
-#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__APPLE__))
+#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__APPLE__) || defined(__linux__))
void* m;
errno = posix_memalign(&m, CACHE_LINE_SIZE, size);
return errno ? nullptr : m;
Loading