drop legacy glibc support
parent
95c4b40caf
commit
64dad0a69f
14
h_malloc.c
14
h_malloc.c
|
@ -1808,24 +1808,18 @@ EXPORT int h_malloc_trim(UNUSED size_t pad) {
|
|||
|
||||
EXPORT void h_malloc_stats(void) {}
|
||||
|
||||
#if defined(__GLIBC__) || defined(__ANDROID__)
|
||||
// glibc mallinfo is broken and replaced with mallinfo2
|
||||
#if defined(__GLIBC__)
|
||||
EXPORT struct mallinfo h_mallinfo(void) {
|
||||
return (struct mallinfo){0};
|
||||
}
|
||||
|
||||
#if __GLIBC_PREREQ(2, 33)
|
||||
#define HAVE_MALLINFO2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MALLINFO2) || defined(__ANDROID__)
|
||||
#ifndef __GLIBC__
|
||||
EXPORT struct mallinfo h_mallinfo(void) {
|
||||
struct mallinfo info = {0};
|
||||
#else
|
||||
EXPORT struct mallinfo2 h_mallinfo2(void) {
|
||||
struct mallinfo2 info = {0};
|
||||
#else
|
||||
EXPORT struct mallinfo h_mallinfo(void) {
|
||||
struct mallinfo info = {0};
|
||||
#endif
|
||||
|
||||
#if CONFIG_STATS
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
static void print_mallinfo2(void) {
|
||||
#if defined(__GLIBC__)
|
||||
#if __GLIBC_PREREQ(2, 33)
|
||||
struct mallinfo2 info = mallinfo2();
|
||||
printf("mallinfo2:\n");
|
||||
printf("arena: %zu\n", (size_t)info.arena);
|
||||
|
@ -23,7 +22,6 @@ static void print_mallinfo2(void) {
|
|||
printf("fordblks: %zu\n", (size_t)info.fordblks);
|
||||
printf("keepcost: %zu\n", (size_t)info.keepcost);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
OPTNONE int main(void) {
|
||||
|
|
Loading…
Reference in New Issue