Main Page | Modules | Class List | File List | Class Members | File Members

memory_stack.c File Reference

#include <gandalf/common/memory_stack.h>
#include <gandalf/common/misc_defs.h>
#include <gandalf/common/misc_error.h>
#include <gandalf/common/allocate.h>
#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <stdarg.h>

Defines

#define TM_TEST_MAGIC   1
#define TM_MAGIC_NUMBER   0x2f3ee7b1

Functions

Gan_MemoryStackgan_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.

Detailed Description

Module: Stack-style first-in first-out memory allocation module

Part of: Gandalf Library

Version:
1.7
Date:
2005/10/18 22:01:50
Author:
pm
Copyright: (c) 2002 Imagineer Software Limited
Generated on Fri Mar 17 12:44:52 2006 by  doxygen 1.3.9.1