File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 3737#define __xstr (s ) __str(s)
3838#define __str (s ) #s
3939
40- #ifdef HAVE_MALLOC_SIZE
41- #define PREFIX_SIZE 0
42- #else
43- /* Use at least 8 bytes alignment on all systems. */
44- #if SIZE_MAX < 0xffffffffffffffffull
45- #define PREFIX_SIZE 8
46- #else
47- #define PREFIX_SIZE (sizeof(size_t))
48- #endif
49- #endif
50-
5140#if defined(USE_TCMALLOC )
5241#define ZMALLOC_LIB ("tcmalloc-" __xstr(TC_VERSION_MAJOR) "." __xstr(TC_VERSION_MINOR))
5342#include <gperftools/tcmalloc.h>
@@ -179,6 +168,17 @@ size_t zmalloc_usable_size(void *ptr);
179168 * obtained from z[*]_usable() family functions, there is no need for this step. */
180169#define zmalloc_usable_size (p ) zmalloc_size(p)
181170
171+ #ifdef HAVE_MALLOC_SIZE
172+ #define PREFIX_SIZE 0
173+ #else
174+ /* Use at least 8 bytes alignment on all systems. */
175+ #if SIZE_MAX < 0xffffffffffffffffull
176+ #define PREFIX_SIZE 8
177+ #else
178+ #define PREFIX_SIZE (sizeof(size_t))
179+ #endif
180+ #endif
181+
182182/* derived from https://github.com/systemd/systemd/pull/25688
183183 * We use zmalloc_usable_size() everywhere to use memory blocks, but that is an abuse since the
184184 * malloc_usable_size() isn't meant for this kind of use, it is for diagnostics only. That is also why the
You can’t perform that action at this time.
0 commit comments