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

ost::SharedMemPager Class Reference

The shared mempager uses a mutex to protect key access methods. mutex protected memory pager. More...

#include <misc.h>

Inheritance diagram for ost::SharedMemPager:

ost::MemPager ost::Mutex List of all members.

Protected Methods

 SharedMemPager (int pagesize=4096)
 Create a mempager mutex pool.

void purge (void)
 Purge the memory pool while locked.

void * first (size_t size)
 Get the first memory page after locking.

void * alloc (size_t size)
 Get the last memory page after locking.


Detailed Description

The shared mempager uses a mutex to protect key access methods. mutex protected memory pager.

This class is used when a mempager will be shared by multiple threads.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ost::SharedMemPager::SharedMemPager int    pagesize = 4096 [protected]
 

Create a mempager mutex pool.

Parameters:
pagesize  page size for allocation.


Member Function Documentation

void* ost::SharedMemPager::alloc size_t    size [protected, virtual]
 

Get the last memory page after locking.

Returns:
allocated memory space.
Parameters:
size  of request.

Reimplemented from ost::MemPager.

void* ost::SharedMemPager::first size_t    size [protected, virtual]
 

Get the first memory page after locking.

Returns:
allocated memory space.
Parameters:
size  of request.

Reimplemented from ost::MemPager.

void ost::SharedMemPager::purge void    [protected]
 

Purge the memory pool while locked.

Reimplemented from ost::MemPager.


The documentation for this class was generated from the following file:
Generated on Thu Nov 21 12:28:33 2002 for GNU CommonC++ by doxygen1.2.18