#include <gandalf/common/misc_defs.h>
#include <stddef.h>
Go to the source code of this file.
Classes | |
struct | Gan_MemoryStack |
Structure to hold state of stack memory blocks. More... | |
Typedefs | |
typedef double | Gan_BigType |
Big C type for byte alignment. | |
typedef Gan_MemoryStack | Gan_MemoryStack |
Structure to hold state of stack memory blocks. | |
Functions | |
Gan_MemoryStack * | gan_memory_stack_form (Gan_MemoryStack *ms, int nblocks, size_t bsize) |
Initialise temporary memory allocation structure. | |
void * | gan_ms_malloc (Gan_MemoryStack *ms, size_t size) |
Temporary memory allocation routine, faster than malloc(). | |
void | gan_ms_free (Gan_MemoryStack *ms, void *ptr) |
Temporary memory free routine. | |
void | gan_ms_free_va (Gan_MemoryStack *ms, void *ptr,...) |
Frees a list of temporaray blocks terminated by NULL . | |
void | gan_memory_stack_free (Gan_MemoryStack *ms) |
Frees all temporary memory. | |
void | gan_memory_stack_clean (Gan_MemoryStack *ms) |
Frees unused temporary memory. | |
size_t | gan_memory_stack_total (Gan_MemoryStack *ms) |
Returns the total temporary memory currently allocated. | |
Gan_MemoryStack * | gan_memory_stack_alloc (int nblocks, size_t bsize) |
Macro: Allocate and initialise temporary memory allocation structure. | |
void * | gan_ms_malloc_object (Gan_MemoryStack *ms, TYPE obj_type) |
Macro: Dynamically allocate one item of a specific type with "stack" memory. | |
void * | gan_ms_malloc_array (Gan_MemoryStack *ms, TYPE obj_type, size_t size) |
Macro: Dynamically allocate n items of a specific type with "stack" memory. |
Part of: Gandalf Library