Main Page   Namespace List   Class Hierarchy   Alphabetical List   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 ()
const int * getBegin ()
const 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

const int * MemCache::getBegin  
 

const 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 on Wed Nov 3 12:59:45 2004 for Lemur Toolkit by doxygen1.2.18