Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Nov 17, 2024
1 parent 3b42cf6 commit d77e81e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/zmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@
#define __xstr(s) __str(s)
#define __str(s) #s

#ifdef HAVE_MALLOC_SIZE
#define PREFIX_SIZE 0
#else
/* Use at least 8 bytes alignment on all systems. */
#if SIZE_MAX < 0xffffffffffffffffull
#define PREFIX_SIZE 8
#else
#define PREFIX_SIZE (sizeof(size_t))
#endif
#endif

#if defined(USE_TCMALLOC)
#define ZMALLOC_LIB ("tcmalloc-" __xstr(TC_VERSION_MAJOR) "." __xstr(TC_VERSION_MINOR))
#include <gperftools/tcmalloc.h>
Expand Down Expand Up @@ -179,6 +168,17 @@ size_t zmalloc_usable_size(void *ptr);
* obtained from z[*]_usable() family functions, there is no need for this step. */
#define zmalloc_usable_size(p) zmalloc_size(p)

#ifdef HAVE_MALLOC_SIZE
#define PREFIX_SIZE 0
#else
/* Use at least 8 bytes alignment on all systems. */
#if SIZE_MAX < 0xffffffffffffffffull
#define PREFIX_SIZE 8
#else
#define PREFIX_SIZE (sizeof(size_t))
#endif
#endif

/* derived from https://github.com/systemd/systemd/pull/25688
* We use zmalloc_usable_size() everywhere to use memory blocks, but that is an abuse since the
* malloc_usable_size() isn't meant for this kind of use, it is for diagnostics only. That is also why the
Expand Down

0 comments on commit d77e81e

Please sign in to comment.