limit more glibc cruft to that environment

This commit is contained in:
Daniel Micay 2019-04-07 00:24:23 -04:00
parent ec8fb347ed
commit 1eed432b9a
2 changed files with 7 additions and 1 deletions

View File

@ -1461,7 +1461,9 @@ EXPORT void h_free(void *p) {
thread_seal_metadata(); thread_seal_metadata();
} }
#ifdef __GLIBC__
EXPORT void h_cfree(void *ptr) ALIAS(h_free); EXPORT void h_cfree(void *ptr) ALIAS(h_free);
#endif
EXPORT void h_free_sized(void *p, size_t expected_size) { EXPORT void h_free_sized(void *p, size_t expected_size) {
if (p == NULL) { if (p == NULL) {
@ -1639,7 +1641,6 @@ EXPORT int h_malloc_info(UNUSED int options, UNUSED FILE *fp) {
errno = ENOSYS; errno = ENOSYS;
return -1; return -1;
} }
#endif
COLD EXPORT void *h_malloc_get_state(void) { COLD EXPORT void *h_malloc_get_state(void) {
return NULL; return NULL;
@ -1648,6 +1649,7 @@ COLD EXPORT void *h_malloc_get_state(void) {
COLD EXPORT int h_malloc_set_state(UNUSED void *state) { COLD EXPORT int h_malloc_set_state(UNUSED void *state) {
return -2; return -2;
} }
#endif
#ifdef __ANDROID__ #ifdef __ANDROID__
EXPORT size_t __mallinfo_narenas(void) { EXPORT size_t __mallinfo_narenas(void) {

View File

@ -63,15 +63,19 @@ void h_malloc_stats(void);
#if defined(__GLIBC__) || defined(__ANDROID__) #if defined(__GLIBC__) || defined(__ANDROID__)
struct mallinfo h_mallinfo(void); struct mallinfo h_mallinfo(void);
#endif #endif
#ifdef __GLIBC__
int h_malloc_info(int options, FILE *fp); int h_malloc_info(int options, FILE *fp);
#endif
// obsolete glibc extensions // obsolete glibc extensions
void *h_memalign(size_t alignment, size_t size); void *h_memalign(size_t alignment, size_t size);
void *h_valloc(size_t size); void *h_valloc(size_t size);
void *h_pvalloc(size_t size); void *h_pvalloc(size_t size);
#ifdef __GLIBC__
void h_cfree(void *ptr); void h_cfree(void *ptr);
void *h_malloc_get_state(void); void *h_malloc_get_state(void);
int h_malloc_set_state(void *state); int h_malloc_set_state(void *state);
#endif
// Android extensions // Android extensions
#ifdef __ANDROID__ #ifdef __ANDROID__