diff --git a/malloc.c b/malloc.c index 9de8e4a..e4d6c50 100644 --- a/malloc.c +++ b/malloc.c @@ -1049,9 +1049,11 @@ EXPORT int h_malloc_trim(UNUSED size_t pad) { EXPORT void h_malloc_stats(void) {} +#if defined(__GLIBC__) || defined(__ANDROID__) EXPORT struct mallinfo h_mallinfo(void) { return (struct mallinfo){0}; } +#endif EXPORT int h_malloc_info(UNUSED int options, UNUSED FILE *fp) { errno = ENOSYS; diff --git a/malloc.h b/malloc.h index 8f5bbc1..9073c29 100644 --- a/malloc.h +++ b/malloc.h @@ -51,7 +51,9 @@ size_t h_malloc_usable_size(void *ptr); int h_mallopt(int param, int value); int h_malloc_trim(size_t pad); void h_malloc_stats(void); +#if defined(__GLIBC__) || defined(__ANDROID__) struct mallinfo h_mallinfo(void); +#endif int h_malloc_info(int options, FILE *fp); // obsolete glibc extensions