Unverified Commit ae7d5bf6 authored by Yossi Gottlieb's avatar Yossi Gottlieb Committed by GitHub
Browse files

Use malloc_usable_size() on FreeBSD. (#8545)

parent e3667cb9
...@@ -61,9 +61,12 @@ ...@@ -61,9 +61,12 @@
#define zmalloc_size(p) malloc_size(p) #define zmalloc_size(p) malloc_size(p)
#endif #endif
/* On native libc implementations, we should still do our best to provide a
* HAVE_MALLOC_SIZE capability.
*/
#ifndef ZMALLOC_LIB #ifndef ZMALLOC_LIB
#define ZMALLOC_LIB "libc" #define ZMALLOC_LIB "libc"
#ifdef __GLIBC__ #if defined(__GLIBC__) || defined(__FreeBSD__)
#include <malloc.h> #include <malloc.h>
#define HAVE_MALLOC_SIZE 1 #define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) malloc_usable_size(p) #define zmalloc_size(p) malloc_usable_size(p)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment