mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
Derive arena constants from MALLOCX_ARENA_BITS
Replaces the hardcoded values for `MALLCTL_ARENAS_ALL` and `MALLCTL_ARENAS_DESTROYED` with expressions derived from `MALLOCX_ARENA_BITS`. This prevents a potential crash (e.g., in stats printing) that would occur if `MALLOCX_ARENA_BITS` were changed while these macro values remained hardcoded. Signed-off-by: Xin Yang <yangxin.dev@bytedance.com>
This commit is contained in:
parent
5e460bfea2
commit
366bfc781b
1 changed files with 2 additions and 2 deletions
|
|
@ -44,12 +44,12 @@
|
|||
* mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".purge", NULL, NULL, NULL,
|
||||
* 0);
|
||||
*/
|
||||
#define MALLCTL_ARENAS_ALL 4096
|
||||
#define MALLCTL_ARENAS_ALL (1U << MALLOCX_ARENA_BITS)
|
||||
/*
|
||||
* Use as arena index in "stats.arenas.<i>.*" mallctl interfaces to select
|
||||
* destroyed arenas.
|
||||
*/
|
||||
#define MALLCTL_ARENAS_DESTROYED 4097
|
||||
#define MALLCTL_ARENAS_DESTROYED ((1U << MALLOCX_ARENA_BITS) + 1)
|
||||
|
||||
#if defined(__cplusplus) && defined(JEMALLOC_USE_CXX_THROW)
|
||||
# define JEMALLOC_CXX_THROW noexcept (true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue