| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef FE_MEMUTILS_H |
| #define FE_MEMUTILS_H |
|
|
| |
| |
| |
| |
| #define MCXT_ALLOC_HUGE 0x01 |
| |
| #define MCXT_ALLOC_NO_OOM 0x02 |
| #define MCXT_ALLOC_ZERO 0x04 |
|
|
| |
| |
| |
| |
| extern char *pg_strdup(const char *in); |
| extern void *pg_malloc(size_t size); |
| extern void *pg_malloc0(size_t size); |
| extern void *pg_malloc_extended(size_t size, int flags); |
| extern void *pg_realloc(void *ptr, size_t size); |
| extern void pg_free(void *ptr); |
|
|
| |
| |
| |
|
|
| |
| |
| |
| #define pg_malloc_object(type) ((type *) pg_malloc(sizeof(type))) |
| #define pg_malloc0_object(type) ((type *) pg_malloc0(sizeof(type))) |
|
|
| |
| |
| |
| #define pg_malloc_array(type, count) ((type *) pg_malloc(sizeof(type) * (count))) |
| #define pg_malloc0_array(type, count) ((type *) pg_malloc0(sizeof(type) * (count))) |
|
|
| |
| |
| |
| |
| #define pg_realloc_array(pointer, type, count) ((type *) pg_realloc(pointer, sizeof(type) * (count))) |
|
|
| |
| extern char *pstrdup(const char *in); |
| extern char *pnstrdup(const char *in, Size size); |
| extern void *palloc(Size size); |
| extern void *palloc0(Size size); |
| extern void *palloc_extended(Size size, int flags); |
| extern void *repalloc(void *pointer, Size size); |
| extern void pfree(void *pointer); |
|
|
| #define palloc_object(type) ((type *) palloc(sizeof(type))) |
| #define palloc0_object(type) ((type *) palloc0(sizeof(type))) |
| #define palloc_array(type, count) ((type *) palloc(sizeof(type) * (count))) |
| #define palloc0_array(type, count) ((type *) palloc0(sizeof(type) * (count))) |
| #define repalloc_array(pointer, type, count) ((type *) repalloc(pointer, sizeof(type) * (count))) |
|
|
| |
| extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2); |
| extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0); |
|
|
| #endif |
|
|