diff --git a/include/jemalloc/internal/prof_types.h b/include/jemalloc/internal/prof_types.h index 4abe5b58..98750f3c 100644 --- a/include/jemalloc/internal/prof_types.h +++ b/include/jemalloc/internal/prof_types.h @@ -29,7 +29,12 @@ typedef struct prof_recent_s prof_recent_t; #define PROF_CKH_MINITEMS 64 /* Size of memory buffer to use when writing dump files. */ -#define PROF_DUMP_BUFSIZE 65536 +#ifndef JEMALLOC_PROF +/* Minimize memory bloat for non-prof builds. */ +# define PROF_DUMP_BUFSIZE 1 +#else +# define PROF_DUMP_BUFSIZE 65536 +#endif /* Size of stack-allocated buffer used by prof_printf(). */ #define PROF_PRINTF_BUFSIZE 128 diff --git a/src/prof_data.c b/src/prof_data.c index 0de728b0..d5f55241 100644 --- a/src/prof_data.c +++ b/src/prof_data.c @@ -59,14 +59,7 @@ static prof_tdata_tree_t tdatas; * This buffer is rather large for stack allocation, so use a single buffer for * all profile dumps. */ -static char prof_dump_buf[ - /* Minimize memory bloat for non-prof builds. */ -#ifdef JEMALLOC_PROF - PROF_DUMP_BUFSIZE -#else - 1 -#endif -]; +static char prof_dump_buf[PROF_DUMP_BUFSIZE]; static size_t prof_dump_buf_end; static int prof_dump_fd;