Revert jemalloc and supress all warnings because we cannot supress some general ones with another flag

This commit is contained in:
Danila Kutenin 2019-05-31 20:33:29 +03:00
parent f8668e4f01
commit 203d336f1f
6 changed files with 72 additions and 102 deletions

2
contrib/jemalloc vendored

@ -1 +1 @@
Subproject commit 2d6d099fed05b1509e81e54458516528bfbbf38d Subproject commit cd2931ad9bbd78208565716ab102e86d858c2fff

View File

@ -25,7 +25,6 @@ ${JEMALLOC_SOURCE_DIR}/src/nstime.c
${JEMALLOC_SOURCE_DIR}/src/pages.c ${JEMALLOC_SOURCE_DIR}/src/pages.c
${JEMALLOC_SOURCE_DIR}/src/prng.c ${JEMALLOC_SOURCE_DIR}/src/prng.c
${JEMALLOC_SOURCE_DIR}/src/prof.c ${JEMALLOC_SOURCE_DIR}/src/prof.c
${JEMALLOC_SOURCE_DIR}/src/safety_check.c
${JEMALLOC_SOURCE_DIR}/src/rtree.c ${JEMALLOC_SOURCE_DIR}/src/rtree.c
${JEMALLOC_SOURCE_DIR}/src/sc.c ${JEMALLOC_SOURCE_DIR}/src/sc.c
${JEMALLOC_SOURCE_DIR}/src/stats.c ${JEMALLOC_SOURCE_DIR}/src/stats.c
@ -42,7 +41,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
endif() endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-attributes") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
endif () endif ()
add_library(jemalloc STATIC ${SRCS}) add_library(jemalloc STATIC ${SRCS})

View File

@ -18,13 +18,13 @@
* Define overrides for non-standard allocator-related functions if they are * Define overrides for non-standard allocator-related functions if they are
* present on the system. * present on the system.
*/ */
#define JEMALLOC_OVERRIDE___LIBC_CALLOC #define JEMALLOC_OVERRIDE___LIBC_CALLOC
#define JEMALLOC_OVERRIDE___LIBC_FREE #define JEMALLOC_OVERRIDE___LIBC_FREE
#define JEMALLOC_OVERRIDE___LIBC_MALLOC #define JEMALLOC_OVERRIDE___LIBC_MALLOC
#define JEMALLOC_OVERRIDE___LIBC_MEMALIGN #define JEMALLOC_OVERRIDE___LIBC_MEMALIGN
#define JEMALLOC_OVERRIDE___LIBC_REALLOC #define JEMALLOC_OVERRIDE___LIBC_REALLOC
#define JEMALLOC_OVERRIDE___LIBC_VALLOC #define JEMALLOC_OVERRIDE___LIBC_VALLOC
#define JEMALLOC_OVERRIDE___POSIX_MEMALIGN #define JEMALLOC_OVERRIDE___POSIX_MEMALIGN
/* /*
* JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs. * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
@ -54,26 +54,44 @@
/* Defined if GCC __atomic atomics are available. */ /* Defined if GCC __atomic atomics are available. */
#define JEMALLOC_GCC_ATOMIC_ATOMICS 1 #define JEMALLOC_GCC_ATOMIC_ATOMICS 1
/* and the 8-bit variant support. */
#define JEMALLOC_GCC_U8_ATOMIC_ATOMICS 1
/* Defined if GCC __sync atomics are available. */ /* Defined if GCC __sync atomics are available. */
#define JEMALLOC_GCC_SYNC_ATOMICS 1 #define JEMALLOC_GCC_SYNC_ATOMICS 1
/* and the 8-bit variant support. */
#define JEMALLOC_GCC_U8_SYNC_ATOMICS 1 /*
* Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and
* __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the
* functions are defined in libgcc instead of being inlines).
*/
/* #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4 */
/*
* Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and
* __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the
* functions are defined in libgcc instead of being inlines).
*/
/* #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8 */
/* /*
* Defined if __builtin_clz() and __builtin_clzl() are available. * Defined if __builtin_clz() and __builtin_clzl() are available.
*/ */
#define JEMALLOC_HAVE_BUILTIN_CLZ #define JEMALLOC_HAVE_BUILTIN_CLZ
/* /*
* Defined if os_unfair_lock_*() functions are available, as provided by Darwin. * Defined if os_unfair_lock_*() functions are available, as provided by Darwin.
*/ */
/* #undef JEMALLOC_OS_UNFAIR_LOCK */ /* #undef JEMALLOC_OS_UNFAIR_LOCK */
/*
* Defined if OSSpin*() functions are available, as provided by Darwin, and
* documented in the spinlock(3) manual page.
*/
/* #undef JEMALLOC_OSSPIN */
/* Defined if syscall(2) is usable. */ /* Defined if syscall(2) is usable. */
#define JEMALLOC_USE_SYSCALL #define JEMALLOC_USE_SYSCALL
/* /*
* Defined if secure_getenv(3) is available. * Defined if secure_getenv(3) is available.
@ -87,10 +105,10 @@
/* #undef JEMALLOC_HAVE_ISSETUGID */ /* #undef JEMALLOC_HAVE_ISSETUGID */
/* Defined if pthread_atfork(3) is available. */ /* Defined if pthread_atfork(3) is available. */
#define JEMALLOC_HAVE_PTHREAD_ATFORK #define JEMALLOC_HAVE_PTHREAD_ATFORK
/* Defined if pthread_setname_np(3) is available. */ /* Defined if pthread_setname_np(3) is available. */
#define JEMALLOC_HAVE_PTHREAD_SETNAME_NP #define JEMALLOC_HAVE_PTHREAD_SETNAME_NP
/* /*
* Defined if clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is available. * Defined if clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is available.
@ -121,7 +139,7 @@
* Among other things, it must be possible to initialize a mutex without * Among other things, it must be possible to initialize a mutex without
* triggering allocation in order for threaded allocation to be safe. * triggering allocation in order for threaded allocation to be safe.
*/ */
#define JEMALLOC_THREADED_INIT #define JEMALLOC_THREADED_INIT
/* /*
* Defined if the pthreads implementation defines * Defined if the pthreads implementation defines
@ -140,10 +158,7 @@
/* #undef JEMALLOC_DEBUG */ /* #undef JEMALLOC_DEBUG */
/* JEMALLOC_STATS enables statistics calculation. */ /* JEMALLOC_STATS enables statistics calculation. */
#define JEMALLOC_STATS #define JEMALLOC_STATS
/* JEMALLOC_EXPERIMENTAL_SMALLOCX_API enables experimental smallocx API. */
/* #undef JEMALLOC_EXPERIMENTAL_SMALLOCX_API */
/* JEMALLOC_PROF enables allocation profiling. */ /* JEMALLOC_PROF enables allocation profiling. */
/* #undef JEMALLOC_PROF */ /* #undef JEMALLOC_PROF */
@ -161,10 +176,10 @@
* JEMALLOC_DSS enables use of sbrk(2) to allocate extents from the data storage * JEMALLOC_DSS enables use of sbrk(2) to allocate extents from the data storage
* segment (DSS). * segment (DSS).
*/ */
#define JEMALLOC_DSS #define JEMALLOC_DSS
/* Support memory filling (junk/zero). */ /* Support memory filling (junk/zero). */
#define JEMALLOC_FILL #define JEMALLOC_FILL
/* Support utrace(2)-based tracing. */ /* Support utrace(2)-based tracing. */
/* #undef JEMALLOC_UTRACE */ /* #undef JEMALLOC_UTRACE */
@ -198,7 +213,7 @@
* VirtualAlloc()/VirtualFree() operations must be precisely matched, i.e. * VirtualAlloc()/VirtualFree() operations must be precisely matched, i.e.
* mappings do *not* coalesce/fragment. * mappings do *not* coalesce/fragment.
*/ */
#define JEMALLOC_MAPS_COALESCE #define JEMALLOC_MAPS_COALESCE
/* /*
* If defined, retain memory for later reuse by default rather than using e.g. * If defined, retain memory for later reuse by default rather than using e.g.
@ -206,10 +221,10 @@
* common sequences of mmap()/munmap() calls will cause virtual memory map * common sequences of mmap()/munmap() calls will cause virtual memory map
* holes. * holes.
*/ */
#define JEMALLOC_RETAIN #define JEMALLOC_RETAIN
/* TLS is used to map arenas and magazine caches to threads. */ /* TLS is used to map arenas and magazine caches to threads. */
#define JEMALLOC_TLS #define JEMALLOC_TLS
/* /*
* Used to mark unreachable code to quiet "end of non-void" compiler warnings. * Used to mark unreachable code to quiet "end of non-void" compiler warnings.
@ -225,17 +240,11 @@
#define JEMALLOC_INTERNAL_FFSL __builtin_ffsl #define JEMALLOC_INTERNAL_FFSL __builtin_ffsl
#define JEMALLOC_INTERNAL_FFS __builtin_ffs #define JEMALLOC_INTERNAL_FFS __builtin_ffs
/*
* popcount*() functions to use for bitmapping.
*/
#define JEMALLOC_INTERNAL_POPCOUNTL __builtin_popcountl
#define JEMALLOC_INTERNAL_POPCOUNT __builtin_popcount
/* /*
* If defined, explicitly attempt to more uniformly distribute large allocation * If defined, explicitly attempt to more uniformly distribute large allocation
* pointer alignments across all cache indices. * pointer alignments across all cache indices.
*/ */
#define JEMALLOC_CACHE_OBLIVIOUS #define JEMALLOC_CACHE_OBLIVIOUS
/* /*
* If defined, enable logging facilities. We make this a configure option to * If defined, enable logging facilities. We make this a configure option to
@ -243,12 +252,6 @@
*/ */
/* #undef JEMALLOC_LOG */ /* #undef JEMALLOC_LOG */
/*
* If defined, use readlinkat() (instead of readlink()) to follow
* /etc/malloc_conf.
*/
/* #undef JEMALLOC_READLINKAT */
/* /*
* Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings. * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
*/ */
@ -261,16 +264,16 @@
* JEMALLOC_SYSCTL_VM_OVERCOMMIT: FreeBSD's vm.overcommit sysctl. * JEMALLOC_SYSCTL_VM_OVERCOMMIT: FreeBSD's vm.overcommit sysctl.
*/ */
/* #undef JEMALLOC_SYSCTL_VM_OVERCOMMIT */ /* #undef JEMALLOC_SYSCTL_VM_OVERCOMMIT */
#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY #define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY
/* Defined if madvise(2) is available. */ /* Defined if madvise(2) is available. */
#define JEMALLOC_HAVE_MADVISE #define JEMALLOC_HAVE_MADVISE
/* /*
* Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE * Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE
* arguments to madvise(2). * arguments to madvise(2).
*/ */
#define JEMALLOC_HAVE_MADVISE_HUGE #define JEMALLOC_HAVE_MADVISE_HUGE
/* /*
* Methods for purging unused pages differ between operating systems. * Methods for purging unused pages differ between operating systems.
@ -285,17 +288,17 @@
* MADV_FREE, though typically with higher * MADV_FREE, though typically with higher
* system overhead. * system overhead.
*/ */
//#define JEMALLOC_PURGE_MADVISE_FREE //#define JEMALLOC_PURGE_MADVISE_FREE
#define JEMALLOC_PURGE_MADVISE_DONTNEED #define JEMALLOC_PURGE_MADVISE_DONTNEED
#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS #define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS
/* Defined if madvise(2) is available but MADV_FREE is not (x86 Linux only). */ /* Defined if madvise(2) is available but MADV_FREE is not (x86 Linux only). */
#define JEMALLOC_DEFINE_MADVISE_FREE /* #undef JEMALLOC_DEFINE_MADVISE_FREE */
/* /*
* Defined if MADV_DO[NT]DUMP is supported as an argument to madvise. * Defined if MADV_DO[NT]DUMP is supported as an argument to madvise.
*/ */
#define JEMALLOC_MADVISE_DONTDUMP #define JEMALLOC_MADVISE_DONTDUMP
/* /*
* Defined if transparent huge pages (THPs) are supported via the * Defined if transparent huge pages (THPs) are supported via the
@ -325,25 +328,25 @@
#define LG_SIZEOF_INTMAX_T 3 #define LG_SIZEOF_INTMAX_T 3
/* glibc malloc hooks (__malloc_hook, __realloc_hook, __free_hook). */ /* glibc malloc hooks (__malloc_hook, __realloc_hook, __free_hook). */
#define JEMALLOC_GLIBC_MALLOC_HOOK #define JEMALLOC_GLIBC_MALLOC_HOOK
/* glibc memalign hook. */ /* glibc memalign hook. */
#define JEMALLOC_GLIBC_MEMALIGN_HOOK #define JEMALLOC_GLIBC_MEMALIGN_HOOK
/* pthread support */ /* pthread support */
#define JEMALLOC_HAVE_PTHREAD #define JEMALLOC_HAVE_PTHREAD
/* dlsym() support */ /* dlsym() support */
#define JEMALLOC_HAVE_DLSYM #define JEMALLOC_HAVE_DLSYM
/* Adaptive mutex support in pthreads. */ /* Adaptive mutex support in pthreads. */
#define JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP #define JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
/* GNU specific sched_getcpu support */ /* GNU specific sched_getcpu support */
#define JEMALLOC_HAVE_SCHED_GETCPU #define JEMALLOC_HAVE_SCHED_GETCPU
/* GNU specific sched_setaffinity support */ /* GNU specific sched_setaffinity support */
#define JEMALLOC_HAVE_SCHED_SETAFFINITY #define JEMALLOC_HAVE_SCHED_SETAFFINITY
/* /*
* If defined, all the features necessary for background threads are present. * If defined, all the features necessary for background threads are present.
@ -365,9 +368,6 @@
/* /*
* Defined if strerror_r returns char * if _GNU_SOURCE is defined. * Defined if strerror_r returns char * if _GNU_SOURCE is defined.
*/ */
#define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE #define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE
/* Performs additional safety checks when defined. */
/* #undef JEMALLOC_OPT_SAFETY_CHECKS */
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */ #endif /* JEMALLOC_INTERNAL_DEFS_H_ */

View File

@ -21,7 +21,7 @@
# include "jemalloc/jemalloc.h" # include "jemalloc/jemalloc.h"
#endif #endif
#if defined(JEMALLOC_OSATOMIC) #if (defined(JEMALLOC_OSATOMIC) || defined(JEMALLOC_OSSPIN))
#include <libkern/OSAtomic.h> #include <libkern/OSAtomic.h>
#endif #endif
@ -161,26 +161,7 @@ static const bool config_log =
false false
#endif #endif
; ;
/* #ifdef JEMALLOC_HAVE_SCHED_GETCPU
* Are extra safety checks enabled; things like checking the size of sized
* deallocations, double-frees, etc.
*/
static const bool config_opt_safety_checks =
#ifdef JEMALLOC_OPT_SAFETY_CHECKS
true
#elif defined(JEMALLOC_DEBUG)
/*
* This lets us only guard safety checks by one flag instead of two; fast
* checks can guard solely by config_opt_safety_checks and run in debug mode
* too.
*/
true
#else
false
#endif
;
#if defined(_WIN32) || defined(JEMALLOC_HAVE_SCHED_GETCPU)
/* Currently percpu_arena depends on sched_getcpu. */ /* Currently percpu_arena depends on sched_getcpu. */
#define JEMALLOC_PERCPU_ARENA #define JEMALLOC_PERCPU_ARENA
#endif #endif

View File

@ -1,22 +1,19 @@
/* include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */ /* include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */
/* Defined if __attribute__((...)) syntax is supported. */ /* Defined if __attribute__((...)) syntax is supported. */
#define JEMALLOC_HAVE_ATTR #define JEMALLOC_HAVE_ATTR
/* Defined if alloc_size attribute is supported. */ /* Defined if alloc_size attribute is supported. */
#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE #define JEMALLOC_HAVE_ATTR_ALLOC_SIZE
/* Defined if format_arg(...) attribute is supported. */
#define JEMALLOC_HAVE_ATTR_FORMAT_ARG
/* Defined if format(printf, ...) attribute is supported. */ /* Defined if format(printf, ...) attribute is supported. */
#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF #define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF
/* /*
* Define overrides for non-standard allocator-related functions if they are * Define overrides for non-standard allocator-related functions if they are
* present on the system. * present on the system.
*/ */
#define JEMALLOC_OVERRIDE_MEMALIGN #define JEMALLOC_OVERRIDE_MEMALIGN
#define JEMALLOC_OVERRIDE_VALLOC #define JEMALLOC_OVERRIDE_VALLOC
/* /*
* At least Linux omits the "const" in: * At least Linux omits the "const" in:
@ -25,14 +22,14 @@
* *
* Match the operating system's prototype. * Match the operating system's prototype.
*/ */
#define JEMALLOC_USABLE_SIZE_CONST #define JEMALLOC_USABLE_SIZE_CONST
/* /*
* If defined, specify throw() for the public function prototypes when compiling * If defined, specify throw() for the public function prototypes when compiling
* with C++. The only justification for this is to match the prototypes that * with C++. The only justification for this is to match the prototypes that
* glibc defines. * glibc defines.
*/ */
#define JEMALLOC_USE_CXX_THROW #define JEMALLOC_USE_CXX_THROW
#ifdef _MSC_VER #ifdef _MSC_VER
# ifdef _WIN64 # ifdef _WIN64

View File

@ -4,13 +4,12 @@
#include <limits.h> #include <limits.h>
#include <strings.h> #include <strings.h>
#define JEMALLOC_VERSION "5.2.0-29-g40a3435b8dc225ad61329aca89d9c8d0dfbc03ab" #define JEMALLOC_VERSION "5.1.0-56-g41b7372eadee941b9164751b8d4963f915d3ceae"
#define JEMALLOC_VERSION_MAJOR 5 #define JEMALLOC_VERSION_MAJOR 5
#define JEMALLOC_VERSION_MINOR 2 #define JEMALLOC_VERSION_MINOR 1
#define JEMALLOC_VERSION_BUGFIX 0 #define JEMALLOC_VERSION_BUGFIX 0
#define JEMALLOC_VERSION_NREV 29 #define JEMALLOC_VERSION_NREV 56
#define JEMALLOC_VERSION_GID "40a3435b8dc225ad61329aca89d9c8d0dfbc03ab" #define JEMALLOC_VERSION_GID "41b7372eadee941b9164751b8d4963f915d3ceae"
#define JEMALLOC_VERSION_GID_IDENT 40a3435b8dc225ad61329aca89d9c8d0dfbc03ab
#define MALLOCX_LG_ALIGN(la) ((int)(la)) #define MALLOCX_LG_ALIGN(la) ((int)(la))
#if LG_SIZEOF_PTR == 2 #if LG_SIZEOF_PTR == 2
@ -69,7 +68,6 @@
# define JEMALLOC_EXPORT __declspec(dllimport) # define JEMALLOC_EXPORT __declspec(dllimport)
# endif # endif
# endif # endif
# define JEMALLOC_FORMAT_ARG(i)
# define JEMALLOC_FORMAT_PRINTF(s, i) # define JEMALLOC_FORMAT_PRINTF(s, i)
# define JEMALLOC_NOINLINE __declspec(noinline) # define JEMALLOC_NOINLINE __declspec(noinline)
# ifdef __cplusplus # ifdef __cplusplus
@ -97,11 +95,6 @@
# ifndef JEMALLOC_EXPORT # ifndef JEMALLOC_EXPORT
# define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default")) # define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
# endif # endif
# ifdef JEMALLOC_HAVE_ATTR_FORMAT_ARG
# define JEMALLOC_FORMAT_ARG(i) JEMALLOC_ATTR(__format_arg__(3))
# else
# define JEMALLOC_FORMAT_ARG(i)
# endif
# ifdef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF # ifdef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
# define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(gnu_printf, s, i)) # define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(gnu_printf, s, i))
# elif defined(JEMALLOC_HAVE_ATTR_FORMAT_PRINTF) # elif defined(JEMALLOC_HAVE_ATTR_FORMAT_PRINTF)