Use malloc_usable_size() on FreeBSD. (#8545)
This commit is contained in:
parent
e3667cb908
commit
ae7d5bf617
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user