The shared mempager uses a mutex to protect key access methods.
More...
#include <misc.h>
|
| SharedMemPager (size_t pagesize=4096, const char *name=NULL) |
| Create a mempager mutex pool. More...
|
|
void | purge (void) |
| Purge the memory pool while locked. More...
|
|
void * | first (size_t size) |
| Get the first memory page after locking. More...
|
|
void * | alloc (size_t size) |
| Get the last memory page after locking. More...
|
|
|
| Mutex (const char *name=NULL) |
| The mutex is always initialized as a recursive entity. More...
|
|
virtual | ~Mutex () |
| Destroying the mutex removes any system resources associated with it. More...
|
|
void | nameMutex (const char *name) |
| Enable setting of mutex name for deadlock debug. More...
|
|
void | enterMutex (void) |
| Entering a Mutex locks the mutex for the current thread. More...
|
|
void | enter (void) |
| Future abi will use enter/leave/test members. More...
|
|
void | leave (void) |
| Future abi will use enter/leave/test members. More...
|
|
bool | test (void) |
| Future abi will use enter/leave/test members. More...
|
|
bool | tryEnterMutex (void) |
| Tries to lock the mutex for the current thread. More...
|
|
void | leaveMutex (void) |
| Leaving a mutex frees that mutex for use by another thread. More...
|
|
static void | setDebug (bool mode) |
| Enable or disable deadlock debugging. More...
|
|
The shared mempager uses a mutex to protect key access methods.
This class is used when a mempager will be shared by multiple threads.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m
mutex protected memory pager.
◆ SharedMemPager()
ost::SharedMemPager::SharedMemPager |
( |
size_t |
pagesize = 4096 , |
|
|
const char * |
name = NULL |
|
) |
| |
|
protected |
Create a mempager mutex pool.
- Parameters
-
pagesize | page size for allocation. |
name | a name for the pool. |
◆ alloc()
void* ost::SharedMemPager::alloc |
( |
size_t |
size | ) |
|
|
protectedvirtual |
Get the last memory page after locking.
- Returns
- allocated memory space.
- Parameters
-
Reimplemented from ost::MemPager.
◆ first()
void* ost::SharedMemPager::first |
( |
size_t |
size | ) |
|
|
protectedvirtual |
Get the first memory page after locking.
- Returns
- allocated memory space.
- Parameters
-
Reimplemented from ost::MemPager.
◆ purge()
void ost::SharedMemPager::purge |
( |
void |
| ) |
|
|
protected |
Purge the memory pool while locked.
The documentation for this class was generated from the following file: