| #include <stddef.h> | #include <stddef.h> | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #ifdef __cplusplus | |||||
| extern "C" { | |||||
| #endif | |||||
| struct smalloc_pool; | struct smalloc_pool; | ||||
| typedef size_t (*smalloc_oom_handler)(struct smalloc_pool *, size_t); | typedef size_t (*smalloc_oom_handler)(struct smalloc_pool *, size_t); | ||||
| */ | */ | ||||
| int sm_malloc_stats(size_t *, size_t *, size_t *, int *); | int sm_malloc_stats(size_t *, size_t *, size_t *, int *); | ||||
| #ifdef __cplusplus | |||||
| } // extern "C" | |||||
| #endif | |||||
| #endif | #endif |
| #include <limits.h> | #include <limits.h> | ||||
| #include <errno.h> | #include <errno.h> | ||||
| #ifdef __cplusplus | |||||
| extern "C" { | |||||
| #endif | |||||
| struct smalloc_hdr { | struct smalloc_hdr { | ||||
| size_t rsz; /* real allocated size with overhead (if any) */ | size_t rsz; /* real allocated size with overhead (if any) */ | ||||
| size_t usz; /* exact user size as reported by s_szalloc */ | size_t usz; /* exact user size as reported by s_szalloc */ | ||||
| void *sm_realloc_pool_i(struct smalloc_pool *spool, void *p, size_t n, int nomove); | void *sm_realloc_pool_i(struct smalloc_pool *spool, void *p, size_t n, int nomove); | ||||
| #ifdef __cplusplus | |||||
| } // extern "C" | |||||
| #endif | |||||
| #endif | #endif |