const char *malloc_conf = NULL;
-#define MALLOCX_ZERO ((int)0x40)
+/*
+ * The MALLOCX_ZERO and MALLOCX_ZERO_GET macros were taken literal from
+ * jemalloc_macros.h and jemalloc_internal_types.h headers respectively.
+ */
+
+#define MALLOCX_ZERO ((int)0x40)
+#define MALLOCX_ZERO_GET(flags) ((bool)(flags & MALLOCX_ZERO))
typedef union {
size_t size;
si->size = size;
ptr = &si[1];
- if ((flags & MALLOCX_ZERO) != 0) {
+ if (MALLOCX_ZERO_GET(flags)) {
memset(ptr, 0, size);
}
size_info *si = realloc(&(((size_info *)ptr)[-1]), size + sizeof(*si));
INSIST(si != NULL);
- if ((flags & MALLOCX_ZERO) != 0 && size > si->size) {
+ if (MALLOCX_ZERO_GET(flags) && size > si->size) {
memset((uint8_t *)si + sizeof(*si) + si->size, 0,
size - si->size);
}