123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- #ifndef _MALLOC_H
- #define _MALLOC_H 1
- #include <features.h>
- #include <stddef.h>
- #include <stdio.h>
- #ifdef _LIBC
- # define __MALLOC_HOOK_VOLATILE
- # define __MALLOC_DEPRECATED
- #else
- # define __MALLOC_HOOK_VOLATILE volatile
- # define __MALLOC_DEPRECATED __attribute_deprecated__
- #endif
- __BEGIN_DECLS
- extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
- extern void *calloc (size_t __nmemb, size_t __size)
- __THROW __attribute_malloc__ __wur;
- extern void *realloc (void *__ptr, size_t __size)
- __THROW __attribute_warn_unused_result__;
- extern void free (void *__ptr) __THROW;
- extern void cfree (void *__ptr) __THROW;
- extern void *memalign (size_t __alignment, size_t __size)
- __THROW __attribute_malloc__ __wur;
- extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
- extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur;
- extern void *(*__morecore) (ptrdiff_t __size);
- extern void *__default_morecore (ptrdiff_t __size)
- __THROW __attribute_malloc__;
- struct mallinfo
- {
- int arena;
- int ordblks;
- int smblks;
- int hblks;
- int hblkhd;
- int usmblks;
- int fsmblks;
- int uordblks;
- int fordblks;
- int keepcost;
- };
- extern struct mallinfo mallinfo (void) __THROW;
- #ifndef M_MXFAST
- # define M_MXFAST 1
- #endif
- #ifndef M_NLBLKS
- # define M_NLBLKS 2
- #endif
- #ifndef M_GRAIN
- # define M_GRAIN 3
- #endif
- #ifndef M_KEEP
- # define M_KEEP 4
- #endif
- #define M_TRIM_THRESHOLD -1
- #define M_TOP_PAD -2
- #define M_MMAP_THRESHOLD -3
- #define M_MMAP_MAX -4
- #define M_CHECK_ACTION -5
- #define M_PERTURB -6
- #define M_ARENA_TEST -7
- #define M_ARENA_MAX -8
- extern int mallopt (int __param, int __val) __THROW;
- extern int malloc_trim (size_t __pad) __THROW;
- extern size_t malloc_usable_size (void *__ptr) __THROW;
- extern void malloc_stats (void) __THROW;
- extern int malloc_info (int __options, FILE *__fp) __THROW;
- extern void *malloc_get_state (void) __THROW;
- extern int malloc_set_state (void *__ptr) __THROW;
- extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void)
- __MALLOC_DEPRECATED;
- extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr,
- const void *)
- __MALLOC_DEPRECATED;
- extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook)(size_t __size,
- const void *)
- __MALLOC_DEPRECATED;
- extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook)(void *__ptr,
- size_t __size,
- const void *)
- __MALLOC_DEPRECATED;
- extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment,
- size_t __size,
- const void *)
- __MALLOC_DEPRECATED;
- extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void);
- extern void __malloc_check_init (void) __THROW __MALLOC_DEPRECATED;
- __END_DECLS
- #endif
|