diff options
| author | Jason Evans <jasone@canonware.com> | 2017-01-03 07:27:42 -0800 |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2017-01-06 18:58:45 -0800 |
| commit | 3dc4e83ccb448436894fbbd0b46f126cff0c1416 (patch) | |
| tree | 4e1daf065fd1b1e157b2f9b6fc66e7a9e030a9ed /include | |
| parent | 027ace8519eb4ed736568082cc7e96b3f9423de8 (diff) | |
| download | platform_external_jemalloc_new-3dc4e83ccb448436894fbbd0b46f126cff0c1416.tar.gz platform_external_jemalloc_new-3dc4e83ccb448436894fbbd0b46f126cff0c1416.tar.bz2 platform_external_jemalloc_new-3dc4e83ccb448436894fbbd0b46f126cff0c1416.zip | |
Add MALLCTL_ARENAS_ALL.
Add the MALLCTL_ARENAS_ALL cpp macro as a fixed index for use
in accessing the arena.<i>.{purge,decay,dss} and stats.arenas.<i>.*
mallctls, and deprecate access via the arenas.narenas index (to be
removed in 6.0.0).
Diffstat (limited to 'include')
| -rw-r--r-- | include/jemalloc/internal/util.h | 4 | ||||
| -rw-r--r-- | include/jemalloc/jemalloc_macros.h.in | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/jemalloc/internal/util.h b/include/jemalloc/internal/util.h index d9f97416..592806dc 100644 --- a/include/jemalloc/internal/util.h +++ b/include/jemalloc/internal/util.h @@ -54,6 +54,10 @@ */ #define JEMALLOC_ARG_CONCAT(...) __VA_ARGS__ +/* cpp macro definition stringification. */ +#define STRINGIFY_HELPER(x) #x +#define STRINGIFY(x) STRINGIFY_HELPER(x) + /* * Silence compiler warnings due to uninitialized values. This is used * wherever the compiler fails to recognize that the variable is never used diff --git a/include/jemalloc/jemalloc_macros.h.in b/include/jemalloc/jemalloc_macros.h.in index f1a8049d..ea41e2e8 100644 --- a/include/jemalloc/jemalloc_macros.h.in +++ b/include/jemalloc/jemalloc_macros.h.in @@ -31,6 +31,20 @@ */ #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 + #if defined(__cplusplus) && defined(JEMALLOC_USE_CXX_THROW) # define JEMALLOC_CXX_THROW throw() #else |
