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

ShmAllocator::BlocksList Class Reference

#include <ShmAllocator.h>

List of all members.

Public Member Functions

 BlocksList (size_t totalSize, void *blockStart)
 ~BlocksList ()
void * getBlock (size_t n)
void returnBlock (void *p) throw (MemException)
size_t accumFreeMemorySize ()
size_t getTotalSize ()
size_t getFreeSize ()
size_t getNumOfBlocks ()


Detailed Description

Class handling memory allocations from a previously allocated memory block.

Author:
Nir Shahaf
Version:
0.1


Constructor & Destructor Documentation

ShmAllocator::BlocksList::BlocksList size_t  totalSize,
void *  blockStart
 

Constructor.

Parameters:
totalSize Size of the pre-allocated block.
blockStart Address of the pre-allocated block.

ShmAllocator::BlocksList::~BlocksList  ) 
 

Destructor.


Member Function Documentation

size_t ShmAllocator::BlocksList::accumFreeMemorySize  ) 
 

Accumulates all the free space in the list.

Returns:
The "real" free memory.

void* ShmAllocator::BlocksList::getBlock size_t  n  ) 
 

Gets a memory chunk of the requested size.

Parameters:
n The size to allocate.
Returns:
Pointer to the allocated space.

size_t ShmAllocator::BlocksList::getFreeSize  ) 
 

Gets the free size left in the block.

Returns:
The free size left in the block.

size_t ShmAllocator::BlocksList::getNumOfBlocks  ) 
 

Gets the number of nodes in the list.

Returns:
The number of nodes in the list.

size_t ShmAllocator::BlocksList::getTotalSize  ) 
 

Gets the total size of the block.

Returns:
The total size of the block.

void ShmAllocator::BlocksList::returnBlock void *  p  )  throw (MemException)
 

Returns space to the block.

Parameters:
p Pointer to the space to return.


The documentation for this class was generated from the following file:
Generated on Thu Jan 27 10:06:44 2005 for ShmAllocator by doxygen 1.3.6