Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
llvm-watermarker
Commits
fda8ef19
Commit
fda8ef19
authored
Jan 16, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jemallocへの埋め込み実験を追加
parent
2e0e0053
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1495 additions
and
0 deletions
+1495
-0
.gitmodules
.gitmodules
+3
-0
common.mk
common.mk
+1
-0
Makefile
example/Makefile
+2
-0
Makefile
example/jemalloc/Makefile
+72
-0
jemalloc_internal_defs.h
...malloc/include/jemalloc/internal/jemalloc_internal_defs.h
+376
-0
jemalloc_preamble.h
...le/jemalloc/include/jemalloc/internal/jemalloc_preamble.h
+194
-0
private_namespace.h
...le/jemalloc/include/jemalloc/internal/private_namespace.h
+416
-0
jemalloc.h
example/jemalloc/include/jemalloc/jemalloc.h
+425
-0
jemalloc
example/jemalloc/jemalloc
+1
-0
aggregate.sh
scripts/aggregate.sh
+4
-0
analyze.sh
scripts/analyze.sh
+1
-0
No files found.
.gitmodules
View file @
fda8ef19
...
...
@@ -13,3 +13,6 @@
[submodule "example/tree/tree"]
path = example/tree/tree
url = git://github.com/execjosh/tree.git
[submodule "example/jemalloc/jemalloc"]
path = example/jemalloc/jemalloc
url = git://github.com/jemalloc/jemalloc.git
common.mk
View file @
fda8ef19
.DEFAULT_GOAL := all
BUILD_TYPE := release
#BUILD_TYPE := debug
ROOT := $(realpath ${PWD})
CD := $(realpath ${CURDIR})
...
...
example/Makefile
View file @
fda8ef19
...
...
@@ -7,6 +7,7 @@ all:
${
MAKE
}
-C
lua all
${
MAKE
}
-C
cJSON all
${
MAKE
}
-C
tree all
${
MAKE
}
-C
jemalloc all
${
MAKE
}
-C
fizzbuzz-rs all
${
MAKE
}
-C
numguess-rs all
...
...
@@ -17,6 +18,7 @@ test:
${
MAKE
}
-C
lua
test
${
MAKE
}
-C
cJSON
test
${
MAKE
}
-C
tree
test
${
MAKE
}
-C
jemalloc
test
${
MAKE
}
-C
fizzbuzz-rs
test
${
MAKE
}
-C
numguess-rs
test
...
...
example/jemalloc/Makefile
0 → 100644
View file @
fda8ef19
include
../../common.mk
WATERMARK
:=
jemalloc-watermarking
CFLAGS
:=
-std
=
gnu11
-Wno-ignored-attributes
-D_GNU_SOURCE
-Ijemalloc
/include
-Iinclude
CFLAGS_debug
:=
-O0
CFLAGS_release
:=
-O2
-DNDEBUG
CFLAGS
+=
${
CFLAGS_
${
BUILD_TYPE
}}
SRCS
:=
\
jemalloc/src/arena.c
\
jemalloc/src/background_thread.c
\
jemalloc/src/base.c
\
jemalloc/src/bin.c
\
jemalloc/src/bitmap.c
\
jemalloc/src/ckh.c
\
jemalloc/src/ctl.c
\
jemalloc/src/div.c
\
jemalloc/src/extent.c
\
jemalloc/src/extent_dss.c
\
jemalloc/src/extent_mmap.c
\
jemalloc/src/hash.c
\
jemalloc/src/hook.c
\
jemalloc/src/jemalloc.c
\
jemalloc/src/large.c
\
jemalloc/src/log.c
\
jemalloc/src/malloc_io.c
\
jemalloc/src/mutex.c
\
jemalloc/src/mutex_pool.c
\
jemalloc/src/nstime.c
\
jemalloc/src/pages.c
\
jemalloc/src/prng.c
\
jemalloc/src/prof.c
\
jemalloc/src/rtree.c
\
jemalloc/src/sc.c
\
jemalloc/src/stats.c
\
jemalloc/src/sz.c
\
jemalloc/src/tcache.c
\
jemalloc/src/test_hooks.c
\
jemalloc/src/ticker.c
\
jemalloc/src/tsd.c
\
jemalloc/src/witness.c
OBJS
:=
${
SRCS
:jemalloc/src/%.c
=
${
OBJ_DIR
}
/%.o
}
OBJS_WM
:=
${
OBJS
:%.o
=%-wm.o
}
LLS
:=
${
OBJS
:.o
=.ll
}
LLS_WM
:=
${
OBJS_WM
:.o
=.ll
}
.PRECIOUS
:
${LLS} ${LLS_WM}
all
:
\
${BIN_DIR}/libjemalloc.a
\
${BIN_DIR}/libjemalloc-wm.a
${BIN_DIR}/libjemalloc.a
:
${OBJS}
${BIN_DIR}/libjemalloc-wm.a
:
${OBJS_WM}
${BIN_DIR}/%.a
:
@
mkdir
-p
${
@D
}
ar rcs
$@
$^
${OBJ_DIR}/%.ll
:
jemalloc/src/%.c
@
mkdir
-p
${
@D
}
clang
-S
-emit-llvm
${
CFLAGS
}
-o
$@
$<
${OBJ_DIR}/%.o
:
${OBJ_DIR}/%.ll
@
mkdir
-p
${
@D
}
clang
-o
$@
-c
$<
${OBJ_DIR}/%-wm.ll
:
${OBJ_DIR}/%.ll
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%-wm.ll
=%-block-wm.ll
}
$<
2>
${
@
:%-wm.ll
=%-block-wm.txt
}
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-inst-wm
-watermark
=
${
WATERMARK
}
-S
-o
$@
${
@
:%-wm.ll
=%-block-wm.ll
}
2>
${
@
:%-wm.ll
=%-inst-wm.txt
}
example/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
0 → 100644
View file @
fda8ef19
/* include/jemalloc/internal/jemalloc_internal_defs.h. Generated from jemalloc_internal_defs.h.in by configure. */
#ifndef JEMALLOC_INTERNAL_DEFS_H_
#define JEMALLOC_INTERNAL_DEFS_H_
/*
* If JEMALLOC_PREFIX is defined via --with-jemalloc-prefix, it will cause all
* public APIs to be prefixed. This makes it possible, with some care, to use
* multiple allocators simultaneously.
*/
/* #undef JEMALLOC_PREFIX */
/* #undef JEMALLOC_CPREFIX */
/*
* Define overrides for non-standard allocator-related functions if they are
* present on the system.
*/
#define JEMALLOC_OVERRIDE___LIBC_CALLOC
#define JEMALLOC_OVERRIDE___LIBC_FREE
#define JEMALLOC_OVERRIDE___LIBC_MALLOC
#define JEMALLOC_OVERRIDE___LIBC_MEMALIGN
#define JEMALLOC_OVERRIDE___LIBC_REALLOC
#define JEMALLOC_OVERRIDE___LIBC_VALLOC
/* #undef JEMALLOC_OVERRIDE___POSIX_MEMALIGN */
/*
* JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
* For shared libraries, symbol visibility mechanisms prevent these symbols
* from being exported, but for static libraries, naming collisions are a real
* possibility.
*/
#define JEMALLOC_PRIVATE_NAMESPACE je_
/*
* Hyper-threaded CPUs may need a special instruction inside spin loops in
* order to yield to another virtual CPU.
*/
#define CPU_SPINWAIT __asm__ volatile("pause")
/* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
#define HAVE_CPU_SPINWAIT 1
/*
* Number of significant bits in virtual addresses. This may be less than the
* total number of bits in a pointer, e.g. on x64, for which the uppermost 16
* bits are the same as bit 47.
*/
#define LG_VADDR 48
/* Defined if C11 atomics are available. */
#define JEMALLOC_C11_ATOMICS 1
/* Defined if GCC __atomic atomics are available. */
#define JEMALLOC_GCC_ATOMIC_ATOMICS 1
/* Defined if GCC __sync atomics are available. */
#define JEMALLOC_GCC_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.
*/
#define JEMALLOC_HAVE_BUILTIN_CLZ
/*
* Defined if os_unfair_lock_*() functions are available, as provided by Darwin.
*/
/* #undef JEMALLOC_OS_UNFAIR_LOCK */
/* Defined if syscall(2) is usable. */
#define JEMALLOC_USE_SYSCALL
/*
* Defined if secure_getenv(3) is available.
*/
#define JEMALLOC_HAVE_SECURE_GETENV
/*
* Defined if issetugid(2) is available.
*/
/* #undef JEMALLOC_HAVE_ISSETUGID */
/* Defined if pthread_atfork(3) is available. */
#define JEMALLOC_HAVE_PTHREAD_ATFORK
/* Defined if pthread_setname_np(3) is available. */
#define JEMALLOC_HAVE_PTHREAD_SETNAME_NP
/*
* Defined if clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is available.
*/
#define JEMALLOC_HAVE_CLOCK_MONOTONIC_COARSE 1
/*
* Defined if clock_gettime(CLOCK_MONOTONIC, ...) is available.
*/
#define JEMALLOC_HAVE_CLOCK_MONOTONIC 1
/*
* Defined if mach_absolute_time() is available.
*/
/* #undef JEMALLOC_HAVE_MACH_ABSOLUTE_TIME */
/*
* Defined if _malloc_thread_cleanup() exists. At least in the case of
* FreeBSD, pthread_key_create() allocates, which if used during malloc
* bootstrapping will cause recursion into the pthreads library. Therefore, if
* _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in
* malloc_tsd.
*/
/* #undef JEMALLOC_MALLOC_THREAD_CLEANUP */
/*
* Defined if threaded initialization is known to be safe on this platform.
* Among other things, it must be possible to initialize a mutex without
* triggering allocation in order for threaded allocation to be safe.
*/
#define JEMALLOC_THREADED_INIT
/*
* Defined if the pthreads implementation defines
* _pthread_mutex_init_calloc_cb(), in which case the function is used in order
* to avoid recursive allocation during mutex initialization.
*/
/* #undef JEMALLOC_MUTEX_INIT_CB */
/* Non-empty if the tls_model attribute is supported. */
#define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
/*
* JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
* inline functions.
*/
/* #undef JEMALLOC_DEBUG */
/* JEMALLOC_STATS enables statistics calculation. */
#define JEMALLOC_STATS
/* JEMALLOC_EXPERIMENTAL_SMALLOCX_API enables experimental smallocx API. */
/* #undef JEMALLOC_EXPERIMENTAL_SMALLOCX_API */
/* JEMALLOC_PROF enables allocation profiling. */
/* #undef JEMALLOC_PROF */
/* Use libunwind for profile backtracing if defined. */
/* #undef JEMALLOC_PROF_LIBUNWIND */
/* Use libgcc for profile backtracing if defined. */
/* #undef JEMALLOC_PROF_LIBGCC */
/* Use gcc intrinsics for profile backtracing if defined. */
/* #undef JEMALLOC_PROF_GCC */
/*
* JEMALLOC_DSS enables use of sbrk(2) to allocate extents from the data storage
* segment (DSS).
*/
#define JEMALLOC_DSS
/* Support memory filling (junk/zero). */
#define JEMALLOC_FILL
/* Support utrace(2)-based tracing. */
/* #undef JEMALLOC_UTRACE */
/* Support optional abort() on OOM. */
/* #undef JEMALLOC_XMALLOC */
/* Support lazy locking (avoid locking unless a second thread is launched). */
/* #undef JEMALLOC_LAZY_LOCK */
/*
* Minimum allocation alignment is 2^LG_QUANTUM bytes (ignoring tiny size
* classes).
*/
/* #undef LG_QUANTUM */
/* One page is 2^LG_PAGE bytes. */
#define LG_PAGE 12
/*
* One huge page is 2^LG_HUGEPAGE bytes. Note that this is defined even if the
* system does not explicitly support huge pages; system calls that require
* explicit huge page support are separately configured.
*/
#define LG_HUGEPAGE 21
/*
* If defined, adjacent virtual memory mappings with identical attributes
* automatically coalesce, and they fragment when changes are made to subranges.
* This is the normal order of things for mmap()/munmap(), but on Windows
* VirtualAlloc()/VirtualFree() operations must be precisely matched, i.e.
* mappings do *not* coalesce/fragment.
*/
#define JEMALLOC_MAPS_COALESCE
/*
* If defined, retain memory for later reuse by default rather than using e.g.
* munmap() to unmap freed extents. This is enabled on 64-bit Linux because
* common sequences of mmap()/munmap() calls will cause virtual memory map
* holes.
*/
#define JEMALLOC_RETAIN
/* TLS is used to map arenas and magazine caches to threads. */
#define JEMALLOC_TLS
/*
* Used to mark unreachable code to quiet "end of non-void" compiler warnings.
* Don't use this directly; instead use unreachable() from util.h
*/
#define JEMALLOC_INTERNAL_UNREACHABLE __builtin_unreachable
/*
* ffs*() functions to use for bitmapping. Don't use these directly; instead,
* use ffs_*() from util.h.
*/
#define JEMALLOC_INTERNAL_FFSLL __builtin_ffsll
#define JEMALLOC_INTERNAL_FFSL __builtin_ffsl
#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
* pointer alignments across all cache indices.
*/
#define JEMALLOC_CACHE_OBLIVIOUS
/*
* If defined, enable logging facilities. We make this a configure option to
* avoid taking extra branches everywhere.
*/
/* #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.
*/
/* #undef JEMALLOC_ZONE */
/*
* Methods for determining whether the OS overcommits.
* JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY: Linux's
* /proc/sys/vm.overcommit_memory file.
* JEMALLOC_SYSCTL_VM_OVERCOMMIT: FreeBSD's vm.overcommit sysctl.
*/
/* #undef JEMALLOC_SYSCTL_VM_OVERCOMMIT */
#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY
/* Defined if madvise(2) is available. */
#define JEMALLOC_HAVE_MADVISE
/*
* Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE
* arguments to madvise(2).
*/
#define JEMALLOC_HAVE_MADVISE_HUGE
/*
* Methods for purging unused pages differ between operating systems.
*
* madvise(..., MADV_FREE) : This marks pages as being unused, such that they
* will be discarded rather than swapped out.
* madvise(..., MADV_DONTNEED) : If JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS is
* defined, this immediately discards pages,
* such that new pages will be demand-zeroed if
* the address region is later touched;
* otherwise this behaves similarly to
* MADV_FREE, though typically with higher
* system overhead.
*/
#define JEMALLOC_PURGE_MADVISE_FREE
#define JEMALLOC_PURGE_MADVISE_DONTNEED
#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS
/* Defined if madvise(2) is available but MADV_FREE is not (x86 Linux only). */
/* #undef JEMALLOC_DEFINE_MADVISE_FREE */
/*
* Defined if MADV_DO[NT]DUMP is supported as an argument to madvise.
*/
#define JEMALLOC_MADVISE_DONTDUMP
/*
* Defined if transparent huge pages (THPs) are supported via the
* MADV_[NO]HUGEPAGE arguments to madvise(2), and THP support is enabled.
*/
/* #undef JEMALLOC_THP */
/* Define if operating system has alloca.h header. */
#define JEMALLOC_HAS_ALLOCA_H 1
/* C99 restrict keyword supported. */
#define JEMALLOC_HAS_RESTRICT 1
/* For use by hash code. */
/* #undef JEMALLOC_BIG_ENDIAN */
/* sizeof(int) == 2^LG_SIZEOF_INT. */
#define LG_SIZEOF_INT 2
/* sizeof(long) == 2^LG_SIZEOF_LONG. */
#define LG_SIZEOF_LONG 3
/* sizeof(long long) == 2^LG_SIZEOF_LONG_LONG. */
#define LG_SIZEOF_LONG_LONG 3
/* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */
#define LG_SIZEOF_INTMAX_T 3
/* glibc malloc hooks (__malloc_hook, __realloc_hook, __free_hook). */
#define JEMALLOC_GLIBC_MALLOC_HOOK
/* glibc memalign hook. */
#define JEMALLOC_GLIBC_MEMALIGN_HOOK
/* pthread support */
#define JEMALLOC_HAVE_PTHREAD
/* dlsym() support */
#define JEMALLOC_HAVE_DLSYM
/* Adaptive mutex support in pthreads. */
#define JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP
/* GNU specific sched_getcpu support */
#define JEMALLOC_HAVE_SCHED_GETCPU
/* GNU specific sched_setaffinity support */
#define JEMALLOC_HAVE_SCHED_SETAFFINITY
/*
* If defined, all the features necessary for background threads are present.
*/
#define JEMALLOC_BACKGROUND_THREAD 1
/*
* If defined, jemalloc symbols are not exported (doesn't work when
* JEMALLOC_PREFIX is not defined).
*/
/* #undef JEMALLOC_EXPORT */
/* config.malloc_conf options string. */
#define JEMALLOC_CONFIG_MALLOC_CONF ""
/* If defined, jemalloc takes the malloc/free/etc. symbol names. */
#define JEMALLOC_IS_MALLOC 1
/*
* Defined if strerror_r returns char * if _GNU_SOURCE is defined.
*/
#define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE
#endif
/* JEMALLOC_INTERNAL_DEFS_H_ */
example/jemalloc/include/jemalloc/internal/jemalloc_preamble.h
0 → 100644
View file @
fda8ef19
#ifndef JEMALLOC_PREAMBLE_H
#define JEMALLOC_PREAMBLE_H
#include "jemalloc_internal_defs.h"
#include "jemalloc/internal/jemalloc_internal_decls.h"
#ifdef JEMALLOC_UTRACE
#include <sys/ktrace.h>
#endif
#define JEMALLOC_NO_DEMANGLE
#ifdef JEMALLOC_JET
# undef JEMALLOC_IS_MALLOC
# define JEMALLOC_N(n) jet_##n
# include "jemalloc/internal/public_namespace.h"
# define JEMALLOC_NO_RENAME
# include "../jemalloc.h"
# undef JEMALLOC_NO_RENAME
#else
# define JEMALLOC_N(n) je_##n
# include "../jemalloc.h"
#endif
#if defined(JEMALLOC_OSATOMIC)
#include <libkern/OSAtomic.h>
#endif
#ifdef JEMALLOC_ZONE
#include <mach/mach_error.h>
#include <mach/mach_init.h>
#include <mach/vm_map.h>
#endif
#include "jemalloc/internal/jemalloc_internal_macros.h"
/*
* Note that the ordering matters here; the hook itself is name-mangled. We
* want the inclusion of hooks to happen early, so that we hook as much as
* possible.
*/
#ifndef JEMALLOC_NO_PRIVATE_NAMESPACE
# ifndef JEMALLOC_JET
# include "jemalloc/internal/private_namespace.h"
# else
# include "jemalloc/internal/private_namespace_jet.h"
# endif
#endif
#include "jemalloc/internal/test_hooks.h"
#ifdef JEMALLOC_DEFINE_MADVISE_FREE
# define JEMALLOC_MADV_FREE 8
#endif
static
const
bool
config_debug
=
#ifdef JEMALLOC_DEBUG
true
#else
false
#endif
;
static
const
bool
have_dss
=
#ifdef JEMALLOC_DSS
true
#else
false
#endif
;
static
const
bool
have_madvise_huge
=
#ifdef JEMALLOC_HAVE_MADVISE_HUGE
true
#else
false
#endif
;
static
const
bool
config_fill
=
#ifdef JEMALLOC_FILL
true
#else
false
#endif
;
static
const
bool
config_lazy_lock
=
#ifdef JEMALLOC_LAZY_LOCK
true
#else
false
#endif
;
static
const
char
*
const
config_malloc_conf
=
JEMALLOC_CONFIG_MALLOC_CONF
;
static
const
bool
config_prof
=
#ifdef JEMALLOC_PROF
true
#else
false
#endif
;
static
const
bool
config_prof_libgcc
=
#ifdef JEMALLOC_PROF_LIBGCC
true
#else
false
#endif
;
static
const
bool
config_prof_libunwind
=
#ifdef JEMALLOC_PROF_LIBUNWIND
true
#else
false
#endif
;
static
const
bool
maps_coalesce
=
#ifdef JEMALLOC_MAPS_COALESCE
true
#else
false
#endif
;
static
const
bool
config_stats
=
#ifdef JEMALLOC_STATS
true
#else
false
#endif
;
static
const
bool
config_tls
=
#ifdef JEMALLOC_TLS
true
#else
false
#endif
;
static
const
bool
config_utrace
=
#ifdef JEMALLOC_UTRACE
true
#else
false
#endif
;
static
const
bool
config_xmalloc
=
#ifdef JEMALLOC_XMALLOC
true
#else
false
#endif
;
static
const
bool
config_cache_oblivious
=
#ifdef JEMALLOC_CACHE_OBLIVIOUS
true
#else
false
#endif
;
/*
* Undocumented, for jemalloc development use only at the moment. See the note
* in jemalloc/internal/log.h.
*/
static
const
bool
config_log
=
#ifdef JEMALLOC_LOG
true
#else
false
#endif
;
#if defined(_WIN32) || defined(JEMALLOC_HAVE_SCHED_GETCPU)
/* Currently percpu_arena depends on sched_getcpu. */
#define JEMALLOC_PERCPU_ARENA
#endif
static
const
bool
have_percpu_arena
=
#ifdef JEMALLOC_PERCPU_ARENA
true
#else
false
#endif
;
/*
* Undocumented, and not recommended; the application should take full
* responsibility for tracking provenance.
*/
static
const
bool
force_ivsalloc
=
#ifdef JEMALLOC_FORCE_IVSALLOC
true
#else
false
#endif
;
static
const
bool
have_background_thread
=
#ifdef JEMALLOC_BACKGROUND_THREAD
true
#else
false
#endif
;
#endif
/* JEMALLOC_PREAMBLE_H */
example/jemalloc/include/jemalloc/internal/private_namespace.h
0 → 100644
View file @
fda8ef19
#define a0dalloc JEMALLOC_N(a0dalloc)
#define a0malloc JEMALLOC_N(a0malloc)
#define arena_choose_hard JEMALLOC_N(arena_choose_hard)
#define arena_cleanup JEMALLOC_N(arena_cleanup)
#define arena_init JEMALLOC_N(arena_init)
#define arena_migrate JEMALLOC_N(arena_migrate)
#define arena_set JEMALLOC_N(arena_set)
#define arena_tdata_get_hard JEMALLOC_N(arena_tdata_get_hard)
#define arenas JEMALLOC_N(arenas)
#define arenas_lock JEMALLOC_N(arenas_lock)
#define arenas_tdata_cleanup JEMALLOC_N(arenas_tdata_cleanup)
#define bootstrap_calloc JEMALLOC_N(bootstrap_calloc)
#define bootstrap_free JEMALLOC_N(bootstrap_free)
#define bootstrap_malloc JEMALLOC_N(bootstrap_malloc)
#define free_default JEMALLOC_N(free_default)
#define iarena_cleanup JEMALLOC_N(iarena_cleanup)
#define jemalloc_postfork_child JEMALLOC_N(jemalloc_postfork_child)
#define jemalloc_postfork_parent JEMALLOC_N(jemalloc_postfork_parent)
#define jemalloc_prefork JEMALLOC_N(jemalloc_prefork)
#define malloc_default JEMALLOC_N(malloc_default)
#define malloc_initialized JEMALLOC_N(malloc_initialized)
#define malloc_slow JEMALLOC_N(malloc_slow)
#define manual_arena_base JEMALLOC_N(manual_arena_base)
#define narenas_auto JEMALLOC_N(narenas_auto)
#define narenas_total_get JEMALLOC_N(narenas_total_get)
#define ncpus JEMALLOC_N(ncpus)
#define opt_abort JEMALLOC_N(opt_abort)
#define opt_abort_conf JEMALLOC_N(opt_abort_conf)
#define opt_junk JEMALLOC_N(opt_junk)
#define opt_junk_alloc JEMALLOC_N(opt_junk_alloc)
#define opt_junk_free JEMALLOC_N(opt_junk_free)
#define opt_narenas JEMALLOC_N(opt_narenas)
#define opt_utrace JEMALLOC_N(opt_utrace)
#define opt_xmalloc JEMALLOC_N(opt_xmalloc)
#define opt_zero JEMALLOC_N(opt_zero)
#define sdallocx_default JEMALLOC_N(sdallocx_default)
#define arena_alloc_junk_small JEMALLOC_N(arena_alloc_junk_small)
#define arena_basic_stats_merge JEMALLOC_N(arena_basic_stats_merge)
#define arena_bin_choose_lock JEMALLOC_N(arena_bin_choose_lock)
#define arena_boot JEMALLOC_N(arena_boot)
#define arena_choose_huge JEMALLOC_N(arena_choose_huge)
#define arena_dalloc_bin_junked_locked JEMALLOC_N(arena_dalloc_bin_junked_locked)
#define arena_dalloc_junk_small JEMALLOC_N(arena_dalloc_junk_small)
#define arena_dalloc_promoted JEMALLOC_N(arena_dalloc_promoted)
#define arena_dalloc_small JEMALLOC_N(arena_dalloc_small)
#define arena_decay JEMALLOC_N(arena_decay)
#define arena_destroy JEMALLOC_N(arena_destroy)
#define arena_dirty_decay_ms_default_get JEMALLOC_N(arena_dirty_decay_ms_default_get)
#define arena_dirty_decay_ms_default_set JEMALLOC_N(arena_dirty_decay_ms_default_set)
#define arena_dirty_decay_ms_get JEMALLOC_N(arena_dirty_decay_ms_get)
#define arena_dirty_decay_ms_set JEMALLOC_N(arena_dirty_decay_ms_set)
#define arena_dss_prec_get JEMALLOC_N(arena_dss_prec_get)
#define arena_dss_prec_set JEMALLOC_N(arena_dss_prec_set)
#define arena_extent_alloc_large JEMALLOC_N(arena_extent_alloc_large)
#define arena_extent_dalloc_large_prep JEMALLOC_N(arena_extent_dalloc_large_prep)
#define arena_extent_ralloc_large_expand JEMALLOC_N(arena_extent_ralloc_large_expand)
#define arena_extent_ralloc_large_shrink JEMALLOC_N(arena_extent_ralloc_large_shrink)
#define arena_extent_sn_next JEMALLOC_N(arena_extent_sn_next)
#define arena_extents_dirty_dalloc JEMALLOC_N(arena_extents_dirty_dalloc)
#define arena_init_huge JEMALLOC_N(arena_init_huge)
#define arena_is_huge JEMALLOC_N(arena_is_huge)
#define arena_malloc_hard JEMALLOC_N(arena_malloc_hard)
#define arena_muzzy_decay_ms_default_get JEMALLOC_N(arena_muzzy_decay_ms_default_get)
#define arena_muzzy_decay_ms_default_set JEMALLOC_N(arena_muzzy_decay_ms_default_set)
#define arena_muzzy_decay_ms_get JEMALLOC_N(arena_muzzy_decay_ms_get)
#define arena_muzzy_decay_ms_set JEMALLOC_N(arena_muzzy_decay_ms_set)
#define arena_new JEMALLOC_N(arena_new)
#define arena_nthreads_dec JEMALLOC_N(arena_nthreads_dec)
#define arena_nthreads_get JEMALLOC_N(arena_nthreads_get)
#define arena_nthreads_inc JEMALLOC_N(arena_nthreads_inc)
#define arena_palloc JEMALLOC_N(arena_palloc)
#define arena_postfork_child JEMALLOC_N(arena_postfork_child)
#define arena_postfork_parent JEMALLOC_N(arena_postfork_parent)
#define arena_prefork0 JEMALLOC_N(arena_prefork0)
#define arena_prefork1 JEMALLOC_N(arena_prefork1)
#define arena_prefork2 JEMALLOC_N(arena_prefork2)
#define arena_prefork3 JEMALLOC_N(arena_prefork3)
#define arena_prefork4 JEMALLOC_N(arena_prefork4)
#define arena_prefork5 JEMALLOC_N(arena_prefork5)
#define arena_prefork6 JEMALLOC_N(arena_prefork6)
#define arena_prefork7 JEMALLOC_N(arena_prefork7)
#define arena_prof_promote JEMALLOC_N(arena_prof_promote)
#define arena_ralloc JEMALLOC_N(arena_ralloc)
#define arena_ralloc_no_move JEMALLOC_N(arena_ralloc_no_move)
#define arena_reset JEMALLOC_N(arena_reset)
#define arena_retain_grow_limit_get_set JEMALLOC_N(arena_retain_grow_limit_get_set)
#define arena_stats_merge JEMALLOC_N(arena_stats_merge)
#define arena_tcache_fill_small JEMALLOC_N(arena_tcache_fill_small)
#define h_steps JEMALLOC_N(h_steps)
#define huge_threshold JEMALLOC_N(huge_threshold)
#define opt_dirty_decay_ms JEMALLOC_N(opt_dirty_decay_ms)
#define opt_huge_threshold JEMALLOC_N(opt_huge_threshold)
#define opt_muzzy_decay_ms JEMALLOC_N(opt_muzzy_decay_ms)
#define opt_percpu_arena JEMALLOC_N(opt_percpu_arena)
#define percpu_arena_mode_names JEMALLOC_N(percpu_arena_mode_names)
#define background_thread_boot0 JEMALLOC_N(background_thread_boot0)
#define background_thread_boot1 JEMALLOC_N(background_thread_boot1)
#define background_thread_create JEMALLOC_N(background_thread_create)
#define background_thread_ctl_init JEMALLOC_N(background_thread_ctl_init)
#define background_thread_enabled_state JEMALLOC_N(background_thread_enabled_state)
#define background_thread_info JEMALLOC_N(background_thread_info)
#define background_thread_interval_check JEMALLOC_N(background_thread_interval_check)
#define background_thread_lock JEMALLOC_N(background_thread_lock)
#define background_thread_postfork_child JEMALLOC_N(background_thread_postfork_child)
#define background_thread_postfork_parent JEMALLOC_N(background_thread_postfork_parent)
#define background_thread_prefork0 JEMALLOC_N(background_thread_prefork0)
#define background_thread_prefork1 JEMALLOC_N(background_thread_prefork1)
#define background_thread_stats_read JEMALLOC_N(background_thread_stats_read)
#define background_threads_disable JEMALLOC_N(background_threads_disable)
#define background_threads_enable JEMALLOC_N(background_threads_enable)
#define max_background_threads JEMALLOC_N(max_background_threads)
#define n_background_threads JEMALLOC_N(n_background_threads)
#define opt_background_thread JEMALLOC_N(opt_background_thread)
#define opt_max_background_threads JEMALLOC_N(opt_max_background_threads)
#define pthread_create_wrapper JEMALLOC_N(pthread_create_wrapper)
#define b0get JEMALLOC_N(b0get)
#define base_alloc JEMALLOC_N(base_alloc)
#define base_alloc_extent JEMALLOC_N(base_alloc_extent)
#define base_boot JEMALLOC_N(base_boot)
#define base_delete JEMALLOC_N(base_delete)
#define base_extent_hooks_get JEMALLOC_N(base_extent_hooks_get)
#define base_extent_hooks_set JEMALLOC_N(base_extent_hooks_set)
#define base_new JEMALLOC_N(base_new)
#define base_postfork_child JEMALLOC_N(base_postfork_child)
#define base_postfork_parent JEMALLOC_N(base_postfork_parent)
#define base_prefork JEMALLOC_N(base_prefork)
#define base_stats_get JEMALLOC_N(base_stats_get)
#define metadata_thp_mode_names JEMALLOC_N(metadata_thp_mode_names)
#define opt_metadata_thp JEMALLOC_N(opt_metadata_thp)
#define bin_boot JEMALLOC_N(bin_boot)
#define bin_infos JEMALLOC_N(bin_infos)
#define bin_init JEMALLOC_N(bin_init)
#define bin_postfork_child JEMALLOC_N(bin_postfork_child)
#define bin_postfork_parent JEMALLOC_N(bin_postfork_parent)
#define bin_prefork JEMALLOC_N(bin_prefork)
#define bin_shard_sizes_boot JEMALLOC_N(bin_shard_sizes_boot)
#define bin_update_shard_size JEMALLOC_N(bin_update_shard_size)
#define bitmap_info_init JEMALLOC_N(bitmap_info_init)
#define bitmap_init JEMALLOC_N(bitmap_init)
#define bitmap_size JEMALLOC_N(bitmap_size)
#define ckh_count JEMALLOC_N(ckh_count)
#define ckh_delete JEMALLOC_N(ckh_delete)
#define ckh_insert JEMALLOC_N(ckh_insert)
#define ckh_iter JEMALLOC_N(ckh_iter)
#define ckh_new JEMALLOC_N(ckh_new)
#define ckh_pointer_hash JEMALLOC_N(ckh_pointer_hash)
#define ckh_pointer_keycomp JEMALLOC_N(ckh_pointer_keycomp)
#define ckh_remove JEMALLOC_N(ckh_remove)
#define ckh_search JEMALLOC_N(ckh_search)
#define ckh_string_hash JEMALLOC_N(ckh_string_hash)
#define ckh_string_keycomp JEMALLOC_N(ckh_string_keycomp)
#define ctl_boot JEMALLOC_N(ctl_boot)
#define ctl_bymib JEMALLOC_N(ctl_bymib)
#define ctl_byname JEMALLOC_N(ctl_byname)
#define ctl_nametomib JEMALLOC_N(ctl_nametomib)
#define ctl_postfork_child JEMALLOC_N(ctl_postfork_child)
#define ctl_postfork_parent JEMALLOC_N(ctl_postfork_parent)
#define ctl_prefork JEMALLOC_N(ctl_prefork)
#define div_init JEMALLOC_N(div_init)
#define extent_alloc JEMALLOC_N(extent_alloc)
#define extent_alloc_wrapper JEMALLOC_N(extent_alloc_wrapper)
#define extent_avail_any JEMALLOC_N(extent_avail_any)
#define extent_avail_empty JEMALLOC_N(extent_avail_empty)
#define extent_avail_first JEMALLOC_N(extent_avail_first)
#define extent_avail_insert JEMALLOC_N(extent_avail_insert)
#define extent_avail_new JEMALLOC_N(extent_avail_new)
#define extent_avail_remove JEMALLOC_N(extent_avail_remove)
#define extent_avail_remove_any JEMALLOC_N(extent_avail_remove_any)
#define extent_avail_remove_first JEMALLOC_N(extent_avail_remove_first)
#define extent_boot JEMALLOC_N(extent_boot)
#define extent_commit_wrapper JEMALLOC_N(extent_commit_wrapper)
#define extent_dalloc JEMALLOC_N(extent_dalloc)
#define extent_dalloc_gap JEMALLOC_N(extent_dalloc_gap)
#define extent_dalloc_wrapper JEMALLOC_N(extent_dalloc_wrapper)
#define extent_decommit_wrapper JEMALLOC_N(extent_decommit_wrapper)
#define extent_destroy_wrapper JEMALLOC_N(extent_destroy_wrapper)
#define extent_heap_any JEMALLOC_N(extent_heap_any)
#define extent_heap_empty JEMALLOC_N(extent_heap_empty)
#define extent_heap_first JEMALLOC_N(extent_heap_first)
#define extent_heap_insert JEMALLOC_N(extent_heap_insert)
#define extent_heap_new JEMALLOC_N(extent_heap_new)
#define extent_heap_remove JEMALLOC_N(extent_heap_remove)
#define extent_heap_remove_any JEMALLOC_N(extent_heap_remove_any)
#define extent_heap_remove_first JEMALLOC_N(extent_heap_remove_first)
#define extent_hooks_default JEMALLOC_N(extent_hooks_default)
#define extent_hooks_get JEMALLOC_N(extent_hooks_get)
#define extent_hooks_set JEMALLOC_N(extent_hooks_set)
#define extent_merge_wrapper JEMALLOC_N(extent_merge_wrapper)
#define extent_mutex_pool JEMALLOC_N(extent_mutex_pool)
#define extent_purge_forced_wrapper JEMALLOC_N(extent_purge_forced_wrapper)
#define extent_purge_lazy_wrapper JEMALLOC_N(extent_purge_lazy_wrapper)
#define extent_split_wrapper JEMALLOC_N(extent_split_wrapper)
#define extents_alloc JEMALLOC_N(extents_alloc)
#define extents_dalloc JEMALLOC_N(extents_dalloc)
#define extents_evict JEMALLOC_N(extents_evict)
#define extents_init JEMALLOC_N(extents_init)
#define extents_nbytes_get JEMALLOC_N(extents_nbytes_get)
#define extents_nextents_get JEMALLOC_N(extents_nextents_get)
#define extents_npages_get JEMALLOC_N(extents_npages_get)
#define extents_postfork_child JEMALLOC_N(extents_postfork_child)
#define extents_postfork_parent JEMALLOC_N(extents_postfork_parent)
#define extents_prefork JEMALLOC_N(extents_prefork)
#define extents_rtree JEMALLOC_N(extents_rtree)
#define extents_state_get JEMALLOC_N(extents_state_get)
#define opt_lg_extent_max_active_fit JEMALLOC_N(opt_lg_extent_max_active_fit)
#define dss_prec_names JEMALLOC_N(dss_prec_names)
#define extent_alloc_dss JEMALLOC_N(extent_alloc_dss)
#define extent_dss_boot JEMALLOC_N(extent_dss_boot)
#define extent_dss_mergeable JEMALLOC_N(extent_dss_mergeable)
#define extent_dss_prec_get JEMALLOC_N(extent_dss_prec_get)
#define extent_dss_prec_set JEMALLOC_N(extent_dss_prec_set)
#define extent_in_dss JEMALLOC_N(extent_in_dss)
#define opt_dss JEMALLOC_N(opt_dss)
#define extent_alloc_mmap JEMALLOC_N(extent_alloc_mmap)
#define extent_dalloc_mmap JEMALLOC_N(extent_dalloc_mmap)
#define opt_retain JEMALLOC_N(opt_retain)
#define hook_boot JEMALLOC_N(hook_boot)
#define hook_install JEMALLOC_N(hook_install)
#define hook_invoke_alloc JEMALLOC_N(hook_invoke_alloc)
#define hook_invoke_dalloc JEMALLOC_N(hook_invoke_dalloc)
#define hook_invoke_expand JEMALLOC_N(hook_invoke_expand)
#define hook_remove JEMALLOC_N(hook_remove)
#define large_dalloc JEMALLOC_N(large_dalloc)
#define large_dalloc_finish JEMALLOC_N(large_dalloc_finish)
#define large_dalloc_junk JEMALLOC_N(large_dalloc_junk)
#define large_dalloc_maybe_junk JEMALLOC_N(large_dalloc_maybe_junk)
#define large_dalloc_prep_junked_locked JEMALLOC_N(large_dalloc_prep_junked_locked)
#define large_malloc JEMALLOC_N(large_malloc)
#define large_palloc JEMALLOC_N(large_palloc)
#define large_prof_alloc_time_get JEMALLOC_N(large_prof_alloc_time_get)
#define large_prof_alloc_time_set JEMALLOC_N(large_prof_alloc_time_set)
#define large_prof_tctx_get JEMALLOC_N(large_prof_tctx_get)
#define large_prof_tctx_reset JEMALLOC_N(large_prof_tctx_reset)
#define large_prof_tctx_set JEMALLOC_N(large_prof_tctx_set)
#define large_ralloc JEMALLOC_N(large_ralloc)
#define large_ralloc_no_move JEMALLOC_N(large_ralloc_no_move)
#define large_salloc JEMALLOC_N(large_salloc)
#define log_init_done JEMALLOC_N(log_init_done)
#define log_var_names JEMALLOC_N(log_var_names)
#define log_var_update_state JEMALLOC_N(log_var_update_state)
#define buferror JEMALLOC_N(buferror)
#define malloc_cprintf JEMALLOC_N(malloc_cprintf)
#define malloc_printf JEMALLOC_N(malloc_printf)
#define malloc_snprintf JEMALLOC_N(malloc_snprintf)
#define malloc_strtoumax JEMALLOC_N(malloc_strtoumax)
#define malloc_vcprintf JEMALLOC_N(malloc_vcprintf)
#define malloc_vsnprintf JEMALLOC_N(malloc_vsnprintf)
#define malloc_write JEMALLOC_N(malloc_write)
#define malloc_mutex_boot JEMALLOC_N(malloc_mutex_boot)
#define malloc_mutex_init JEMALLOC_N(malloc_mutex_init)
#define malloc_mutex_lock_slow JEMALLOC_N(malloc_mutex_lock_slow)
#define malloc_mutex_postfork_child JEMALLOC_N(malloc_mutex_postfork_child)
#define malloc_mutex_postfork_parent JEMALLOC_N(malloc_mutex_postfork_parent)
#define malloc_mutex_prefork JEMALLOC_N(malloc_mutex_prefork)
#define malloc_mutex_prof_data_reset JEMALLOC_N(malloc_mutex_prof_data_reset)
#define mutex_pool_init JEMALLOC_N(mutex_pool_init)
#define nstime_add JEMALLOC_N(nstime_add)
#define nstime_compare JEMALLOC_N(nstime_compare)
#define nstime_copy JEMALLOC_N(nstime_copy)
#define nstime_divide JEMALLOC_N(nstime_divide)
#define nstime_iadd JEMALLOC_N(nstime_iadd)
#define nstime_idivide JEMALLOC_N(nstime_idivide)
#define nstime_imultiply JEMALLOC_N(nstime_imultiply)
#define nstime_init JEMALLOC_N(nstime_init)
#define nstime_init2 JEMALLOC_N(nstime_init2)
#define nstime_isubtract JEMALLOC_N(nstime_isubtract)
#define nstime_monotonic JEMALLOC_N(nstime_monotonic)
#define nstime_msec JEMALLOC_N(nstime_msec)
#define nstime_ns JEMALLOC_N(nstime_ns)
#define nstime_nsec JEMALLOC_N(nstime_nsec)
#define nstime_sec JEMALLOC_N(nstime_sec)
#define nstime_subtract JEMALLOC_N(nstime_subtract)
#define nstime_update JEMALLOC_N(nstime_update)
#define init_system_thp_mode JEMALLOC_N(init_system_thp_mode)
#define opt_thp JEMALLOC_N(opt_thp)
#define pages_boot JEMALLOC_N(pages_boot)
#define pages_commit JEMALLOC_N(pages_commit)
#define pages_decommit JEMALLOC_N(pages_decommit)
#define pages_dodump JEMALLOC_N(pages_dodump)
#define pages_dontdump JEMALLOC_N(pages_dontdump)
#define pages_huge JEMALLOC_N(pages_huge)
#define pages_map JEMALLOC_N(pages_map)
#define pages_nohuge JEMALLOC_N(pages_nohuge)
#define pages_purge_forced JEMALLOC_N(pages_purge_forced)
#define pages_purge_lazy JEMALLOC_N(pages_purge_lazy)
#define pages_set_thp_state JEMALLOC_N(pages_set_thp_state)
#define pages_unmap JEMALLOC_N(pages_unmap)
#define thp_mode_names JEMALLOC_N(thp_mode_names)
#define bt2gctx_mtx JEMALLOC_N(bt2gctx_mtx)
#define bt_init JEMALLOC_N(bt_init)
#define lg_prof_sample JEMALLOC_N(lg_prof_sample)
#define opt_lg_prof_interval JEMALLOC_N(opt_lg_prof_interval)
#define opt_lg_prof_sample JEMALLOC_N(opt_lg_prof_sample)
#define opt_prof JEMALLOC_N(opt_prof)
#define opt_prof_accum JEMALLOC_N(opt_prof_accum)
#define opt_prof_active JEMALLOC_N(opt_prof_active)
#define opt_prof_final JEMALLOC_N(opt_prof_final)
#define opt_prof_gdump JEMALLOC_N(opt_prof_gdump)
#define opt_prof_leak JEMALLOC_N(opt_prof_leak)
#define opt_prof_log JEMALLOC_N(opt_prof_log)
#define opt_prof_prefix JEMALLOC_N(opt_prof_prefix)
#define opt_prof_thread_active_init JEMALLOC_N(opt_prof_thread_active_init)
#define prof_accum_init JEMALLOC_N(prof_accum_init)
#define prof_active JEMALLOC_N(prof_active)
#define prof_active_get JEMALLOC_N(prof_active_get)
#define prof_active_set JEMALLOC_N(prof_active_set)
#define prof_alloc_rollback JEMALLOC_N(prof_alloc_rollback)
#define prof_backtrace JEMALLOC_N(prof_backtrace)
#define prof_boot0 JEMALLOC_N(prof_boot0)
#define prof_boot1 JEMALLOC_N(prof_boot1)
#define prof_boot2 JEMALLOC_N(prof_boot2)
#define prof_dump_header JEMALLOC_N(prof_dump_header)
#define prof_dump_open JEMALLOC_N(prof_dump_open)
#define prof_free_sampled_object JEMALLOC_N(prof_free_sampled_object)
#define prof_gdump JEMALLOC_N(prof_gdump)
#define prof_gdump_get JEMALLOC_N(prof_gdump_get)
#define prof_gdump_set JEMALLOC_N(prof_gdump_set)
#define prof_gdump_val JEMALLOC_N(prof_gdump_val)
#define prof_idump JEMALLOC_N(prof_idump)
#define prof_interval JEMALLOC_N(prof_interval)
#define prof_log_start JEMALLOC_N(prof_log_start)
#define prof_log_stop JEMALLOC_N(prof_log_stop)
#define prof_logging_state JEMALLOC_N(prof_logging_state)
#define prof_lookup JEMALLOC_N(prof_lookup)
#define prof_malloc_sample_object JEMALLOC_N(prof_malloc_sample_object)
#define prof_mdump JEMALLOC_N(prof_mdump)
#define prof_postfork_child JEMALLOC_N(prof_postfork_child)
#define prof_postfork_parent JEMALLOC_N(prof_postfork_parent)
#define prof_prefork0 JEMALLOC_N(prof_prefork0)
#define prof_prefork1 JEMALLOC_N(prof_prefork1)
#define prof_reset JEMALLOC_N(prof_reset)
#define prof_sample_threshold_update JEMALLOC_N(prof_sample_threshold_update)
#define prof_tdata_cleanup JEMALLOC_N(prof_tdata_cleanup)
#define prof_tdata_init JEMALLOC_N(prof_tdata_init)
#define prof_tdata_reinit JEMALLOC_N(prof_tdata_reinit)
#define prof_thread_active_get JEMALLOC_N(prof_thread_active_get)
#define prof_thread_active_init_get JEMALLOC_N(prof_thread_active_init_get)
#define prof_thread_active_init_set JEMALLOC_N(prof_thread_active_init_set)
#define prof_thread_active_set JEMALLOC_N(prof_thread_active_set)
#define prof_thread_name_get JEMALLOC_N(prof_thread_name_get)
#define prof_thread_name_set JEMALLOC_N(prof_thread_name_set)
#define rtree_ctx_data_init JEMALLOC_N(rtree_ctx_data_init)
#define rtree_leaf_alloc JEMALLOC_N(rtree_leaf_alloc)
#define rtree_leaf_dalloc JEMALLOC_N(rtree_leaf_dalloc)
#define rtree_leaf_elm_lookup_hard JEMALLOC_N(rtree_leaf_elm_lookup_hard)
#define rtree_new JEMALLOC_N(rtree_new)
#define rtree_node_alloc JEMALLOC_N(rtree_node_alloc)
#define rtree_node_dalloc JEMALLOC_N(rtree_node_dalloc)
#define arena_mutex_names JEMALLOC_N(arena_mutex_names)
#define global_mutex_names JEMALLOC_N(global_mutex_names)
#define opt_stats_print JEMALLOC_N(opt_stats_print)
#define opt_stats_print_opts JEMALLOC_N(opt_stats_print_opts)
#define stats_print JEMALLOC_N(stats_print)
#define sc_boot JEMALLOC_N(sc_boot)
#define sc_data_global JEMALLOC_N(sc_data_global)
#define sc_data_init JEMALLOC_N(sc_data_init)
#define sc_data_update_slab_size JEMALLOC_N(sc_data_update_slab_size)
#define sz_boot JEMALLOC_N(sz_boot)
#define sz_index2size_tab JEMALLOC_N(sz_index2size_tab)
#define sz_pind2sz_tab JEMALLOC_N(sz_pind2sz_tab)
#define sz_size2index_tab JEMALLOC_N(sz_size2index_tab)
#define nhbins JEMALLOC_N(nhbins)
#define opt_lg_tcache_max JEMALLOC_N(opt_lg_tcache_max)
#define opt_tcache JEMALLOC_N(opt_tcache)
#define tcache_alloc_small_hard JEMALLOC_N(tcache_alloc_small_hard)
#define tcache_arena_associate JEMALLOC_N(tcache_arena_associate)
#define tcache_arena_reassociate JEMALLOC_N(tcache_arena_reassociate)
#define tcache_bin_flush_large JEMALLOC_N(tcache_bin_flush_large)
#define tcache_bin_flush_small JEMALLOC_N(tcache_bin_flush_small)
#define tcache_bin_info JEMALLOC_N(tcache_bin_info)
#define tcache_boot JEMALLOC_N(tcache_boot)
#define tcache_cleanup JEMALLOC_N(tcache_cleanup)
#define tcache_create_explicit JEMALLOC_N(tcache_create_explicit)
#define tcache_event_hard JEMALLOC_N(tcache_event_hard)
#define tcache_flush JEMALLOC_N(tcache_flush)
#define tcache_maxclass JEMALLOC_N(tcache_maxclass)
#define tcache_postfork_child JEMALLOC_N(tcache_postfork_child)
#define tcache_postfork_parent JEMALLOC_N(tcache_postfork_parent)
#define tcache_prefork JEMALLOC_N(tcache_prefork)
#define tcache_salloc JEMALLOC_N(tcache_salloc)
#define tcache_stats_merge JEMALLOC_N(tcache_stats_merge)
#define tcaches JEMALLOC_N(tcaches)
#define tcaches_create JEMALLOC_N(tcaches_create)
#define tcaches_destroy JEMALLOC_N(tcaches_destroy)
#define tcaches_flush JEMALLOC_N(tcaches_flush)
#define tsd_tcache_data_init JEMALLOC_N(tsd_tcache_data_init)
#define tsd_tcache_enabled_data_init JEMALLOC_N(tsd_tcache_enabled_data_init)
#define test_hooks_arena_new_hook JEMALLOC_N(test_hooks_arena_new_hook)
#define test_hooks_libc_hook JEMALLOC_N(test_hooks_libc_hook)
#define malloc_tsd_boot0 JEMALLOC_N(malloc_tsd_boot0)
#define malloc_tsd_boot1 JEMALLOC_N(malloc_tsd_boot1)
#define malloc_tsd_cleanup_register JEMALLOC_N(malloc_tsd_cleanup_register)
#define malloc_tsd_dalloc JEMALLOC_N(malloc_tsd_dalloc)
#define malloc_tsd_malloc JEMALLOC_N(malloc_tsd_malloc)
#define tsd_booted JEMALLOC_N(tsd_booted)
#define tsd_cleanup JEMALLOC_N(tsd_cleanup)
#define tsd_fetch_slow JEMALLOC_N(tsd_fetch_slow)
#define tsd_global_slow JEMALLOC_N(tsd_global_slow)
#define tsd_global_slow_dec JEMALLOC_N(tsd_global_slow_dec)
#define tsd_global_slow_inc JEMALLOC_N(tsd_global_slow_inc)
#define tsd_postfork_child JEMALLOC_N(tsd_postfork_child)
#define tsd_postfork_parent JEMALLOC_N(tsd_postfork_parent)
#define tsd_prefork JEMALLOC_N(tsd_prefork)
#define tsd_slow_update JEMALLOC_N(tsd_slow_update)
#define tsd_state_set JEMALLOC_N(tsd_state_set)
#define tsd_tls JEMALLOC_N(tsd_tls)
#define tsd_tsd JEMALLOC_N(tsd_tsd)
#define witness_depth_error JEMALLOC_N(witness_depth_error)
#define witness_init JEMALLOC_N(witness_init)
#define witness_lock_error JEMALLOC_N(witness_lock_error)
#define witness_not_owner_error JEMALLOC_N(witness_not_owner_error)
#define witness_owner_error JEMALLOC_N(witness_owner_error)
#define witness_postfork_child JEMALLOC_N(witness_postfork_child)
#define witness_postfork_parent JEMALLOC_N(witness_postfork_parent)
#define witness_prefork JEMALLOC_N(witness_prefork)
#define witnesses_cleanup JEMALLOC_N(witnesses_cleanup)
example/jemalloc/include/jemalloc/jemalloc.h
0 → 100644
View file @
fda8ef19
#ifndef JEMALLOC_H_
#define JEMALLOC_H_
#ifdef __cplusplus
extern
"C"
{
#endif
/* Defined if __attribute__((...)) syntax is supported. */
#define JEMALLOC_HAVE_ATTR
/* Defined if alloc_size attribute is supported. */
#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE
/* Defined if format(gnu_printf, ...) attribute is supported. */
#define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
/* Defined if format(printf, ...) attribute is supported. */
#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF
/*
* Define overrides for non-standard allocator-related functions if they are
* present on the system.
*/
#define JEMALLOC_OVERRIDE_MEMALIGN
#define JEMALLOC_OVERRIDE_VALLOC
/*
* At least Linux omits the "const" in:
*
* size_t malloc_usable_size(const void *ptr);
*
* Match the operating system's prototype.
*/
#define JEMALLOC_USABLE_SIZE_CONST
/*
* If defined, specify throw() for the public function prototypes when compiling
* with C++. The only justification for this is to match the prototypes that
* glibc defines.
*/
#define JEMALLOC_USE_CXX_THROW
#ifdef _MSC_VER
# ifdef _WIN64
# define LG_SIZEOF_PTR_WIN 3
# else
# define LG_SIZEOF_PTR_WIN 2
# endif
#endif
/* sizeof(void *) == 2^LG_SIZEOF_PTR. */
#define LG_SIZEOF_PTR 3
/*
* Name mangling for public symbols is controlled by --with-mangling and
* --with-jemalloc-prefix. With default settings the je_ prefix is stripped by
* these macro definitions.
*/
#ifndef JEMALLOC_NO_RENAME
# define je_aligned_alloc aligned_alloc
# define je_calloc calloc
# define je_dallocx dallocx
# define je_free free
# define je_mallctl mallctl
# define je_mallctlbymib mallctlbymib
# define je_mallctlnametomib mallctlnametomib
# define je_malloc malloc
# define je_malloc_conf malloc_conf
# define je_malloc_message malloc_message
# define je_malloc_stats_print malloc_stats_print
# define je_malloc_usable_size malloc_usable_size
# define je_mallocx mallocx
# define je_smallocx_bbe8e6a9097203c7b29140b5410c787a6e204593 smallocx_bbe8e6a9097203c7b29140b5410c787a6e204593
# define je_nallocx nallocx
# define je_posix_memalign posix_memalign
# define je_rallocx rallocx
# define je_realloc realloc
# define je_sallocx sallocx
# define je_sdallocx sdallocx
# define je_xallocx xallocx
# define je_memalign memalign
# define je_valloc valloc
#endif
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <strings.h>
#define JEMALLOC_VERSION "5.1.0-129-gbbe8e6a9097203c7b29140b5410c787a6e204593"
#define JEMALLOC_VERSION_MAJOR 5
#define JEMALLOC_VERSION_MINOR 1
#define JEMALLOC_VERSION_BUGFIX 0
#define JEMALLOC_VERSION_NREV 129
#define JEMALLOC_VERSION_GID "bbe8e6a9097203c7b29140b5410c787a6e204593"
#define JEMALLOC_VERSION_GID_IDENT bbe8e6a9097203c7b29140b5410c787a6e204593
#define MALLOCX_LG_ALIGN(la) ((int)(la))
#if LG_SIZEOF_PTR == 2
# define MALLOCX_ALIGN(a) ((int)(ffs((int)(a))-1))
#else
# define MALLOCX_ALIGN(a) \
((int)(((size_t)(a) < (size_t)INT_MAX) ? ffs((int)(a))-1 : \
ffs((int)(((size_t)(a))>>32))+31))
#endif
#define MALLOCX_ZERO ((int)0x40)
/*
* Bias tcache index bits so that 0 encodes "automatic tcache management", and 1
* encodes MALLOCX_TCACHE_NONE.
*/
#define MALLOCX_TCACHE(tc) ((int)(((tc)+2) << 8))
#define MALLOCX_TCACHE_NONE MALLOCX_TCACHE(-1)
/*
* Bias arena index bits so that 0 encodes "use an automatically chosen arena".
*/
#define MALLOCX_ARENA(a) ((((int)(a))+1) << 20)
/*
* Use as arena index in "arena.<i>.{purge,decay,dss}" and
* "stats.arenas.<i>.*" mallctl interfaces to select all arenas. This
* definition is intentionally specified in raw decimal format to support
* cpp-based string concatenation, e.g.
*
* #define STRINGIFY_HELPER(x) #x
* #define STRINGIFY(x) STRINGIFY_HELPER(x)
*
* mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".purge", NULL, NULL, NULL,
* 0);
*/
#define MALLCTL_ARENAS_ALL 4096
/*
* Use as arena index in "stats.arenas.<i>.*" mallctl interfaces to select
* destroyed arenas.
*/
#define MALLCTL_ARENAS_DESTROYED 4097
#if defined(__cplusplus) && defined(JEMALLOC_USE_CXX_THROW)
# define JEMALLOC_CXX_THROW throw()
#else
# define JEMALLOC_CXX_THROW
#endif
#if defined(_MSC_VER)
# define JEMALLOC_ATTR(s)
# define JEMALLOC_ALIGNED(s) __declspec(align(s))
# define JEMALLOC_ALLOC_SIZE(s)
# define JEMALLOC_ALLOC_SIZE2(s1, s2)
# ifndef JEMALLOC_EXPORT
# ifdef DLLEXPORT
# define JEMALLOC_EXPORT __declspec(dllexport)
# else
# define JEMALLOC_EXPORT __declspec(dllimport)
# endif
# endif
# define JEMALLOC_FORMAT_PRINTF(s, i)
# define JEMALLOC_NOINLINE __declspec(noinline)
# ifdef __cplusplus
# define JEMALLOC_NOTHROW __declspec(nothrow)
# else
# define JEMALLOC_NOTHROW
# endif
# define JEMALLOC_SECTION(s) __declspec(allocate(s))
# define JEMALLOC_RESTRICT_RETURN __declspec(restrict)
# if _MSC_VER >= 1900 && !defined(__EDG__)
# define JEMALLOC_ALLOCATOR __declspec(allocator)
# else
# define JEMALLOC_ALLOCATOR
# endif
#elif defined(JEMALLOC_HAVE_ATTR)
# define JEMALLOC_ATTR(s) __attribute__((s))
# define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
# ifdef JEMALLOC_HAVE_ATTR_ALLOC_SIZE
# define JEMALLOC_ALLOC_SIZE(s) JEMALLOC_ATTR(alloc_size(s))
# define JEMALLOC_ALLOC_SIZE2(s1, s2) JEMALLOC_ATTR(alloc_size(s1, s2))
# else
# define JEMALLOC_ALLOC_SIZE(s)
# define JEMALLOC_ALLOC_SIZE2(s1, s2)
# endif
# ifndef JEMALLOC_EXPORT
# define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
# endif
# ifdef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
# define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(gnu_printf, s, i))
# elif defined(JEMALLOC_HAVE_ATTR_FORMAT_PRINTF)
# define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(printf, s, i))
# else
# define JEMALLOC_FORMAT_PRINTF(s, i)
# endif
# define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline)
# define JEMALLOC_NOTHROW JEMALLOC_ATTR(nothrow)
# define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s))
# define JEMALLOC_RESTRICT_RETURN
# define JEMALLOC_ALLOCATOR
#else
# define JEMALLOC_ATTR(s)
# define JEMALLOC_ALIGNED(s)
# define JEMALLOC_ALLOC_SIZE(s)
# define JEMALLOC_ALLOC_SIZE2(s1, s2)
# define JEMALLOC_EXPORT
# define JEMALLOC_FORMAT_PRINTF(s, i)
# define JEMALLOC_NOINLINE
# define JEMALLOC_NOTHROW
# define JEMALLOC_SECTION(s)
# define JEMALLOC_RESTRICT_RETURN
# define JEMALLOC_ALLOCATOR
#endif
/*
* The je_ prefix on the following public symbol declarations is an artifact
* of namespace management, and should be omitted in application code unless
* JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle.h).
*/
extern
JEMALLOC_EXPORT
const
char
*
je_malloc_conf
;
extern
JEMALLOC_EXPORT
void
(
*
je_malloc_message
)(
void
*
cbopaque
,
const
char
*
s
);
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_malloc
(
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ATTR
(
malloc
)
JEMALLOC_ALLOC_SIZE
(
1
);
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_calloc
(
size_t
num
,
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ATTR
(
malloc
)
JEMALLOC_ALLOC_SIZE2
(
1
,
2
);
JEMALLOC_EXPORT
int
JEMALLOC_NOTHROW
je_posix_memalign
(
void
**
memptr
,
size_t
alignment
,
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ATTR
(
nonnull
(
1
));
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_aligned_alloc
(
size_t
alignment
,
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ATTR
(
malloc
)
JEMALLOC_ALLOC_SIZE
(
2
);
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_realloc
(
void
*
ptr
,
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ALLOC_SIZE
(
2
);
JEMALLOC_EXPORT
void
JEMALLOC_NOTHROW
je_free
(
void
*
ptr
)
JEMALLOC_CXX_THROW
;
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_mallocx
(
size_t
size
,
int
flags
)
JEMALLOC_ATTR
(
malloc
)
JEMALLOC_ALLOC_SIZE
(
1
);
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_rallocx
(
void
*
ptr
,
size_t
size
,
int
flags
)
JEMALLOC_ALLOC_SIZE
(
2
);
JEMALLOC_EXPORT
size_t
JEMALLOC_NOTHROW
je_xallocx
(
void
*
ptr
,
size_t
size
,
size_t
extra
,
int
flags
);
JEMALLOC_EXPORT
size_t
JEMALLOC_NOTHROW
je_sallocx
(
const
void
*
ptr
,
int
flags
)
JEMALLOC_ATTR
(
pure
);
JEMALLOC_EXPORT
void
JEMALLOC_NOTHROW
je_dallocx
(
void
*
ptr
,
int
flags
);
JEMALLOC_EXPORT
void
JEMALLOC_NOTHROW
je_sdallocx
(
void
*
ptr
,
size_t
size
,
int
flags
);
JEMALLOC_EXPORT
size_t
JEMALLOC_NOTHROW
je_nallocx
(
size_t
size
,
int
flags
)
JEMALLOC_ATTR
(
pure
);
JEMALLOC_EXPORT
int
JEMALLOC_NOTHROW
je_mallctl
(
const
char
*
name
,
void
*
oldp
,
size_t
*
oldlenp
,
void
*
newp
,
size_t
newlen
);
JEMALLOC_EXPORT
int
JEMALLOC_NOTHROW
je_mallctlnametomib
(
const
char
*
name
,
size_t
*
mibp
,
size_t
*
miblenp
);
JEMALLOC_EXPORT
int
JEMALLOC_NOTHROW
je_mallctlbymib
(
const
size_t
*
mib
,
size_t
miblen
,
void
*
oldp
,
size_t
*
oldlenp
,
void
*
newp
,
size_t
newlen
);
JEMALLOC_EXPORT
void
JEMALLOC_NOTHROW
je_malloc_stats_print
(
void
(
*
write_cb
)(
void
*
,
const
char
*
),
void
*
je_cbopaque
,
const
char
*
opts
);
JEMALLOC_EXPORT
size_t
JEMALLOC_NOTHROW
je_malloc_usable_size
(
JEMALLOC_USABLE_SIZE_CONST
void
*
ptr
)
JEMALLOC_CXX_THROW
;
#ifdef JEMALLOC_OVERRIDE_MEMALIGN
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_memalign
(
size_t
alignment
,
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ATTR
(
malloc
);
#endif
#ifdef JEMALLOC_OVERRIDE_VALLOC
JEMALLOC_EXPORT
JEMALLOC_ALLOCATOR
JEMALLOC_RESTRICT_RETURN
void
JEMALLOC_NOTHROW
*
je_valloc
(
size_t
size
)
JEMALLOC_CXX_THROW
JEMALLOC_ATTR
(
malloc
);
#endif
typedef
struct
extent_hooks_s
extent_hooks_t
;
/*
* void *
* extent_alloc(extent_hooks_t *extent_hooks, void *new_addr, size_t size,
* size_t alignment, bool *zero, bool *commit, unsigned arena_ind);
*/
typedef
void
*
(
extent_alloc_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
size_t
,
bool
*
,
bool
*
,
unsigned
);
/*
* bool
* extent_dalloc(extent_hooks_t *extent_hooks, void *addr, size_t size,
* bool committed, unsigned arena_ind);
*/
typedef
bool
(
extent_dalloc_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
bool
,
unsigned
);
/*
* void
* extent_destroy(extent_hooks_t *extent_hooks, void *addr, size_t size,
* bool committed, unsigned arena_ind);
*/
typedef
void
(
extent_destroy_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
bool
,
unsigned
);
/*
* bool
* extent_commit(extent_hooks_t *extent_hooks, void *addr, size_t size,
* size_t offset, size_t length, unsigned arena_ind);
*/
typedef
bool
(
extent_commit_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
size_t
,
size_t
,
unsigned
);
/*
* bool
* extent_decommit(extent_hooks_t *extent_hooks, void *addr, size_t size,
* size_t offset, size_t length, unsigned arena_ind);
*/
typedef
bool
(
extent_decommit_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
size_t
,
size_t
,
unsigned
);
/*
* bool
* extent_purge(extent_hooks_t *extent_hooks, void *addr, size_t size,
* size_t offset, size_t length, unsigned arena_ind);
*/
typedef
bool
(
extent_purge_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
size_t
,
size_t
,
unsigned
);
/*
* bool
* extent_split(extent_hooks_t *extent_hooks, void *addr, size_t size,
* size_t size_a, size_t size_b, bool committed, unsigned arena_ind);
*/
typedef
bool
(
extent_split_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
size_t
,
size_t
,
bool
,
unsigned
);
/*
* bool
* extent_merge(extent_hooks_t *extent_hooks, void *addr_a, size_t size_a,
* void *addr_b, size_t size_b, bool committed, unsigned arena_ind);
*/
typedef
bool
(
extent_merge_t
)(
extent_hooks_t
*
,
void
*
,
size_t
,
void
*
,
size_t
,
bool
,
unsigned
);
struct
extent_hooks_s
{
extent_alloc_t
*
alloc
;
extent_dalloc_t
*
dalloc
;
extent_destroy_t
*
destroy
;
extent_commit_t
*
commit
;
extent_decommit_t
*
decommit
;
extent_purge_t
*
purge_lazy
;
extent_purge_t
*
purge_forced
;
extent_split_t
*
split
;
extent_merge_t
*
merge
;
};
/*
* By default application code must explicitly refer to mangled symbol names,
* so that it is possible to use jemalloc in conjunction with another allocator
* in the same application. Define JEMALLOC_MANGLE in order to cause automatic
* name mangling that matches the API prefixing that happened as a result of
* --with-mangling and/or --with-jemalloc-prefix configuration settings.
*/
#ifdef JEMALLOC_MANGLE
# ifndef JEMALLOC_NO_DEMANGLE
# define JEMALLOC_NO_DEMANGLE
# endif
# define aligned_alloc je_aligned_alloc
# define calloc je_calloc
# define dallocx je_dallocx
# define free je_free
# define mallctl je_mallctl
# define mallctlbymib je_mallctlbymib
# define mallctlnametomib je_mallctlnametomib
# define malloc je_malloc
# define malloc_conf je_malloc_conf
# define malloc_message je_malloc_message
# define malloc_stats_print je_malloc_stats_print
# define malloc_usable_size je_malloc_usable_size
# define mallocx je_mallocx
# define smallocx_bbe8e6a9097203c7b29140b5410c787a6e204593 je_smallocx_bbe8e6a9097203c7b29140b5410c787a6e204593
# define nallocx je_nallocx
# define posix_memalign je_posix_memalign
# define rallocx je_rallocx
# define realloc je_realloc
# define sallocx je_sallocx
# define sdallocx je_sdallocx
# define xallocx je_xallocx
# define memalign je_memalign
# define valloc je_valloc
#endif
/*
* The je_* macros can be used as stable alternative names for the
* public jemalloc API if JEMALLOC_NO_DEMANGLE is defined. This is primarily
* meant for use in jemalloc itself, but it can be used by application code to
* provide isolation from the name mangling specified via --with-mangling
* and/or --with-jemalloc-prefix.
*/
#ifndef JEMALLOC_NO_DEMANGLE
# undef je_aligned_alloc
# undef je_calloc
# undef je_dallocx
# undef je_free
# undef je_mallctl
# undef je_mallctlbymib
# undef je_mallctlnametomib
# undef je_malloc
# undef je_malloc_conf
# undef je_malloc_message
# undef je_malloc_stats_print
# undef je_malloc_usable_size
# undef je_mallocx
# undef je_smallocx_bbe8e6a9097203c7b29140b5410c787a6e204593
# undef je_nallocx
# undef je_posix_memalign
# undef je_rallocx
# undef je_realloc
# undef je_sallocx
# undef je_sdallocx
# undef je_xallocx
# undef je_memalign
# undef je_valloc
#endif
#ifdef __cplusplus
}
#endif
#endif
/* JEMALLOC_H_ */
jemalloc
@
bbe8e6a9
Subproject commit bbe8e6a9097203c7b29140b5410c787a6e204593
scripts/aggregate.sh
View file @
fda8ef19
...
...
@@ -54,6 +54,8 @@ echo "==== cJSON block-wm ===="
h1 obj/
$1
/example/cJSON/
*
-block-wm
.txt
echo
"==== tree block-wm ===="
h1 obj/
$1
/example/tree/
*
-block-wm
.txt
echo
"==== jemalloc block-wm ===="
h1 obj/
$1
/example/jemalloc/
*
-block-wm
.txt
echo
"==== fizzbuzz-rs block-wm ===="
h1 obj/
$1
/example/fizzbuzz-rs/
*
-block-wm
.txt
echo
"==== numguess-rs block-wm ===="
...
...
@@ -69,6 +71,8 @@ echo "==== cJSON inst-wm ===="
h2 obj/
$1
/example/cJSON/
*
-inst-wm
.txt
echo
"==== tree inst-wm ===="
h2 obj/
$1
/example/tree/
*
-inst-wm
.txt
echo
"==== jemalloc inst-wm ===="
h2 obj/
$1
/example/jemalloc/
*
-inst-wm
.txt
echo
"==== fizzbuzz-rs inst-wm ===="
h2 obj/
$1
/example/fizzbuzz-rs/
*
-inst-wm
.txt
echo
"==== numguess-rs inst-wm ===="
...
...
scripts/analyze.sh
View file @
fda8ef19
...
...
@@ -26,3 +26,4 @@ h example/zlib/zlib/*.c
h example/lua/lua/
*
.c
h example/cJSON/cJSON/cJSON.c example/cJSON/cJSON/cJSON_Utils.c
h example/tree/tree/
*
.c
h
`
ls
example/jemalloc/jemalloc/src/
*
.c |
awk
-F
'example/jemalloc/jemalloc/src/test_hooks.c'
-F
'example/jemalloc/jemalloc/src/zone.c'
'{print $NF}'
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment