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

Memory_Pool Class Reference

#include <Memory_Pool.h>

List of all members.

Public Member Functions

 Memory_Pool (std::size_t block_size, std::size_t num_blocks)
void * acquire (size_t size)
void release (void *block)


Detailed Description

Memory_Pool implements memory management functionality for using the Eager Acquisition pattern.

Author:
Michael Kircher

Prashant Jain

Version:
1.0


Constructor & Destructor Documentation

Memory_Pool::Memory_Pool std::size_t  block_size,
std::size_t  num_blocks
[inline]
 

Constructor

Parameters:
block_size Size of the memory blocks to be managed.
num_blocks Number of blocks to be eagerly instantiated.


Member Function Documentation

void* Memory_Pool::acquire size_t  size  )  [inline]
 

The acquire() method tries to find a free memory block. If the requested size is too large, an exception is thrown.

Parameters:
size Size of the memory block to be acquired.

void Memory_Pool::release void *  block  )  [inline]
 

The release() method puts the returned memory block back into the list.

Parameters:
block Memory block to be freed.


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

These pages document the source code of the patterns Lookup, Eager Acquisition, and Leasing.

Copyright 2004 John Wiley and Sons. All Rights Reserved.