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

memory_stack.h File Reference

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


Detailed Description

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

Part of: Gandalf Library

Version:
1.1
Date:
2002/09/30 12:26:20
Author:
pm
Copyright: (c) 2002 Imagineer Software Limited
Generated on Sat May 21 23:52:51 2005 by  doxygen 1.4.3