Skip to content
Closed
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
17 changes: 16 additions & 1 deletion cpp/src/plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,22 @@ ADD_ARROW_LIB(plasma

# The optimization flag -O3 is suggested by dlmalloc.c, which is #included in
# malloc.cc; we set it here regardless of whether we do a debug or release build.
set_source_files_properties(malloc.cc PROPERTIES COMPILE_FLAGS "-Wno-error -O3")
set_source_files_properties(malloc.cc PROPERTIES
COMPILE_FLAGS "-O3")

if ("${COMPILER_FAMILY}" STREQUAL "clang")
set_property(SOURCE malloc.cc
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Wno-parentheses-equality -Wno-shorten-64-to-32")
endif()

if ("${COMPILER_FAMILY}" STREQUAL "gcc")
set_property(SOURCE malloc.cc
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Wno-conversion")
endif()

add_executable(plasma_store store.cc)
target_link_libraries(plasma_store plasma_static)
Expand Down
19 changes: 17 additions & 2 deletions cpp/src/plasma/thirdparty/dlmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
improvement at the expense of carrying around more memory.
*/


/* Version identifier to allow people to support multiple versions */
#ifndef DLMALLOC_VERSION
#define DLMALLOC_VERSION 20806
Expand Down Expand Up @@ -584,9 +585,21 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
/* The maximum possible size_t value has all bits set */
#define MAX_SIZE_T (~(size_t)0)

#if (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0)
#define RECURSIVE_LOCKS_ENABLED 1
#else
#define RECURSIVE_LOCKS_ENABLED 0
#endif

#if (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0)
#define SPIN_LOCKS_ENABLED 1
#else
#define SPIN_LOCKS_ENABLED 0
#endif

#ifndef USE_LOCKS /* ensure true if spin or recursive locks set */
#define USE_LOCKS ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \
(defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0))
#define USE_LOCKS ((SPIN_LOCKS_ENABLED != 0) || \
(RECURSIVE_LOCKS_ENABLED != 0))
#endif /* USE_LOCKS */

#if USE_LOCKS /* Spin locks for gcc >= 4.1, older gcc on x86, MSC >= 1310 */
Expand Down Expand Up @@ -645,7 +658,9 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
#ifndef HAVE_MREMAP
#ifdef linux
#define HAVE_MREMAP 1
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* Turns on mremap() definition */
#endif /* _GNU_SOURCE */
#else /* linux */
#define HAVE_MREMAP 0
#endif /* linux */
Expand Down