Use malloc_usable_size() on FreeBSD. (#8545)

This commit is contained in:
Yossi Gottlieb 2021-02-24 09:48:04 +02:00 committed by GitHub
parent e3667cb908
commit ae7d5bf617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,9 +61,12 @@
#define zmalloc_size(p) malloc_size(p)
#endif
/* On native libc implementations, we should still do our best to provide a
* HAVE_MALLOC_SIZE capability.
*/
#ifndef ZMALLOC_LIB
#define ZMALLOC_LIB "libc"
#ifdef __GLIBC__
#if defined(__GLIBC__) || defined(__FreeBSD__)
#include <malloc.h>
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) malloc_usable_size(p)