Fennel: CacheAllocator Class Reference (original) (raw)

CacheAllocator defines an interface for allocating memory pages to be used by the cache. More...

#include <[CacheAllocator.h](CacheAllocator%5F8h-source.html)>

Inheritance diagram for CacheAllocator:

List of all members.

Public Member Functions
virtual ~CacheAllocator ()
virtual void * allocate (int *pErrorCode=NULL)=0
Allocates a chunk of memory of size determined by the constructor.
virtual int deallocate (void *pMem, int *pErrorCode=NULL)=0
Deallocates a chunk of memory.
virtual size_t getBytesAllocated () const=0
**Returns:**number of bytes currently allocated
virtual int setProtection (void *pMem, uint cb, bool readOnly, int *pErrorCode=NULL)=0
Changes protection state for a contiguous range of virtual memory.

Detailed Description

CacheAllocator defines an interface for allocating memory pages to be used by the cache.

Definition at line 33 of file CacheAllocator.h.


Constructor & Destructor Documentation

| CacheAllocator::~CacheAllocator | ( | | ) | [virtual] | | -------------------------------- | - | | - | ----------- |


Member Function Documentation

virtual void* CacheAllocator::allocate ( int * pErrorCode = NULL ) [pure virtual]
virtual int CacheAllocator::deallocate ( void * pMem,
int * pErrorCode = NULL
) [pure virtual]

| virtual size_t CacheAllocator::getBytesAllocated | ( | | ) | const [pure virtual] | | ------------------------------------------------- | - | | - | ---------------------- |

Returns:

number of bytes currently allocated

Implemented in VMAllocator.

virtual int CacheAllocator::setProtection ( void * pMem,
uint cb,
bool readOnly,
int * pErrorCode = NULL
) [pure virtual]

Changes protection state for a contiguous range of virtual memory.

Parameters:

pMem start of range
cb number of bytes in range
readOnly true for read-only; false for read-write (TODO jvs 7-Feb-2006: support no-access as well)
pErrorCode on error and if non-NULL, the int referenced is modified to contain the OS error code

Returns:

0 on success; -1 if an error occurs while manupulating memory protections (see pErrorCode for OS error code)

Implemented in VMAllocator.


The documentation for this class was generated from the following files:


Generated on Mon Jun 22 04:00:27 2009 for Fennel by doxygen 1.5.1