Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

pool Class Reference

This object is used to allocate a single memory pool. More...

#include <pools.h>

Collaboration diagram for pool:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 pool (void)
 ~pool (void)
void new_pool (void)
void delete_pool (void)
void * GetMem (unsigned int num_bytes)
void pr (FILE *fp=stdout)

Private Member Functions

 pool (const pool &p)
 The copy constructor for this class should never be called, so declare private.


Private Attributes

mem_pool< big_block_pool,
MAX_POOLS >::pool_handle 
pool_handle
Boolean allocated
 if a pool object is dymamically allocated from a pool its memory will be initialized to zero.


Detailed Description

This object is used to allocate a single memory pool.

The pool is allocated in the constructor and deallocated in the destructor. This class references the global object memory_pools.

Definition at line 136 of file pools.h.


Constructor & Destructor Documentation

pool::pool const pool p  )  [inline, private]
 

The copy constructor for this class should never be called, so declare private.

Definition at line 142 of file pools.h.

00142 {}

pool::pool void   )  [inline]
 

Definition at line 151 of file pools.h.

References new_pool().

00152     {
00153         new_pool();
00154     }

pool::~pool void   )  [inline]
 

Definition at line 155 of file pools.h.

References delete_pool().

00156     {
00157         delete_pool();
00158     }


Member Function Documentation

void pool::delete_pool void   )  [inline]
 

Definition at line 164 of file pools.h.

References allocated, FALSE, memory_pools, pool_handle, and mem_pool< big_block_pool, MAX_POOLS >::release_pool().

Referenced by sym_component::dealloc(), and ~pool().

00165     {
00166         allocated = FALSE;
00167         memory_pools.release_pool( pool_handle );
00168     }

void* pool::GetMem unsigned int  num_bytes  )  [inline]
 

Definition at line 169 of file pools.h.

References allocated, mem_pool< big_block_pool, MAX_POOLS >::GetMem(), memory_pools, pool_handle, and TRUE.

Referenced by sym_component::GetMem(), strtable::new_item(), type::operator new(), node::operator new(), sym::operator new(), and vhdl_const::operator new().

00170     {
00171         assert( allocated == TRUE );
00172 
00173         return memory_pools.GetMem( pool_handle, num_bytes );
00174     }

void pool::new_pool void   )  [inline]
 

Definition at line 159 of file pools.h.

References allocated, mem_pool< big_block_pool, MAX_POOLS >::get_new_pool(), memory_pools, pool_handle, and TRUE.

Referenced by sym_component::init(), and pool().

00160     {
00161         allocated = TRUE;
00162         pool_handle = memory_pools.get_new_pool();
00163     }

void pool::pr FILE *  fp = stdout  )  [inline]
 

Definition at line 175 of file pools.h.

References memory_pools, pool_handle, and mem_pool< big_block_pool, MAX_POOLS >::pr().

00176     {
00177         memory_pools.pr(fp,  pool_handle );
00178     }


Member Data Documentation

Boolean pool::allocated [private]
 

if a pool object is dymamically allocated from a pool its memory will be initialized to zero.

So allocated will be FALSE;

Definition at line 148 of file pools.h.

Referenced by delete_pool(), GetMem(), and new_pool().

mem_pool<big_block_pool, MAX_POOLS>::pool_handle pool::pool_handle [private]
 

Definition at line 138 of file pools.h.

Referenced by delete_pool(), GetMem(), new_pool(), and pr().


The documentation for this class was generated from the following file:
Generated on Wed Mar 31 21:16:08 2004 for Data Structures for a VHDL Compiler by doxygen 1.3.3