| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include_next <malloc.h> |
| 5 |
|
| 6 |
#include <errno.h> |
| 7 |
#include <stdio.h> |
| 8 |
|
| 9 |
struct mallinfo2 { |
| 10 |
size_t arena; /* non-mmapped space allocated from system */ |
| 11 |
size_t ordblks; /* number of free chunks */ |
| 12 |
size_t smblks; /* number of fastbin blocks */ |
| 13 |
size_t hblks; /* number of mmapped regions */ |
| 14 |
size_t hblkhd; /* space in mmapped regions */ |
| 15 |
size_t usmblks; /* always 0, preserved for backwards compatibility */ |
| 16 |
size_t fsmblks; /* space available in freed fastbin blocks */ |
| 17 |
size_t uordblks; /* total allocated space */ |
| 18 |
size_t fordblks; /* total free space */ |
| 19 |
size_t keepcost; /* top-most, releasable (via malloc_trim) space */ |
| 20 |
}; |
| 21 |
|
| 22 |
static inline struct mallinfo2 mallinfo2(void) { |
| 23 |
return (struct mallinfo2) {}; |
| 24 |
} |
| 25 |
|
| 26 |
static inline int malloc_info(int options, FILE *stream) { |
| 27 |
if (options != 0) |
| 28 |
errno = EINVAL; |
| 29 |
else |
| 30 |
errno = EOPNOTSUPP; |
| 31 |
return -1; |
| 32 |
} |
| 33 |
|
| 34 |
static inline int malloc_trim(size_t pad) { |
| 35 |
return 0; |
| 36 |
} |