Arena.h 611 Bytes
Newer Older
1 2 3 4 5 6 7
/* -----------------------------------------------------------------------------
   (c) The University of Glasgow 2001

   Arena allocation interface.
   -------------------------------------------------------------------------- */

#ifndef ARENA_H
8
#define ARENA_H
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

// Abstract type of arenas
typedef struct _Arena Arena;

// Start a new arena
extern Arena * newArena   ( void );

// Allocate memory in an arena
extern void  * arenaAlloc ( Arena *, size_t );

// Free an entire arena
extern void    arenaFree  ( Arena * );

// For internal use only:
extern unsigned long arenaBlocks( void );

#endif // ARENA_H