| 1 | #ifndef __wasilibc___functions_malloc_h |
| 2 | #define __wasilibc___functions_malloc_h |
| 3 | |
| 4 | #define __need_size_t |
| 5 | #define __need_wchar_t |
| 6 | #define __need_NULL |
| 7 | #include <stddef.h> |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | |
| 13 | void *malloc(size_t __size) __attribute__((__malloc__, __warn_unused_result__)); |
| 14 | void free(void *__ptr); |
| 15 | void *calloc(size_t __nmemb, size_t __size) __attribute__((__malloc__, __warn_unused_result__)); |
| 16 | void *realloc(void *__ptr, size_t __size) __attribute__((__warn_unused_result__)); |
| 17 | |
| 18 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 19 | void *reallocarray(void *__ptr, size_t __nmemb, size_t __size) __attribute__((__warn_unused_result__)); |
| 20 | #endif |
| 21 | |
| 22 | #ifdef __cplusplus |
| 23 | } |
| 24 | #endif |
| 25 | |
| 26 | #endif |