Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MemCache Class Reference

#include <MemCache.hpp>

List of all members.

Public Methods

 MemCache (int cachesize)
 MemCache (int *cache,int cachesize)
 use the given memory.

 MemCache ()
 ~MemCache ()
int* getMem (int chunksize)
int* getMoreMem (int newsize,int *location,int oldsize)
void freeMem (int *location,int memsize)
void flushMem ()
int* getBegin ()
int* getEnd ()


Constructor & Destructor Documentation

MemCache::MemCache ( int cachesize )
 

constructor

Parameters:
cachesize   how much memory to allocate this cache in bytes

MemCache::MemCache ( int * cache,
int cachesize )
 

use the given memory.

MemCache::MemCache ( )
 

default constructor that doesn't do much

MemCache::~MemCache ( )
 

destructor free the memory we allocated


Member Function Documentation

void MemCache::flushMem ( )
 

reinitializes

void MemCache::freeMem ( int * location,
int memsize )
 

"free" the memory at this pointer this cache will remember it in the free list this does not mean delete the memory

Parameters:
location   beginning of location of memory
memsize   how much to free at this location

int * MemCache::getBegin ( )
 

int * MemCache::getEnd ( )
 

int * MemCache::getMem ( int chunksize )
 

Returns:
a pointer to some memory location of size chunksize
Parameters:
chunksize   how much memory we need in bytes as a power of 2,

int * MemCache::getMoreMem ( int newsize,
int * location,
int oldsize )
 

returns pointer to a new location of newsize containing all the elements of the old location

Returns:
NULL if we can't get more memory, or if we are requesting a newsize that is not bigger than the oldsize


The documentation for this class was generated from the following files:
Generated at Fri Jul 26 18:22:52 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000