From 1eed432b9a736d8820360431361679cacf21271a Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 7 Apr 2019 00:24:23 -0400 Subject: [PATCH] limit more glibc cruft to that environment --- h_malloc.c | 4 +++- h_malloc.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/h_malloc.c b/h_malloc.c index 7bc3b10..04aba7c 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -1461,7 +1461,9 @@ EXPORT void h_free(void *p) { thread_seal_metadata(); } +#ifdef __GLIBC__ EXPORT void h_cfree(void *ptr) ALIAS(h_free); +#endif EXPORT void h_free_sized(void *p, size_t expected_size) { if (p == NULL) { @@ -1639,7 +1641,6 @@ EXPORT int h_malloc_info(UNUSED int options, UNUSED FILE *fp) { errno = ENOSYS; return -1; } -#endif COLD EXPORT void *h_malloc_get_state(void) { return NULL; @@ -1648,6 +1649,7 @@ COLD EXPORT void *h_malloc_get_state(void) { COLD EXPORT int h_malloc_set_state(UNUSED void *state) { return -2; } +#endif #ifdef __ANDROID__ EXPORT size_t __mallinfo_narenas(void) { diff --git a/h_malloc.h b/h_malloc.h index 83879f0..81c4fbc 100644 --- a/h_malloc.h +++ b/h_malloc.h @@ -63,15 +63,19 @@ void h_malloc_stats(void); #if defined(__GLIBC__) || defined(__ANDROID__) struct mallinfo h_mallinfo(void); #endif +#ifdef __GLIBC__ int h_malloc_info(int options, FILE *fp); +#endif // obsolete glibc extensions void *h_memalign(size_t alignment, size_t size); void *h_valloc(size_t size); void *h_pvalloc(size_t size); +#ifdef __GLIBC__ void h_cfree(void *ptr); void *h_malloc_get_state(void); int h_malloc_set_state(void *state); +#endif // Android extensions #ifdef __ANDROID__