#include <PagePool.h>
Public Member Functions | |
PagePool (unsigned int page_size, unsigned int capacity, bool locked=true) | |
Allocates capacity page-aligned blocks, each page_size bytes long, all locked into main memory (if locked). | |
~PagePool () | |
Destructor. | |
void * | alloc () |
Allocates and returns a single page. | |
void | free (void *) |
Frees a page. | |
unsigned int | page_size () const |
Returns the page size for the pool (i.e., the page_size argument to the constructor). | |
unsigned int | capacity () const |
Returns the pool capacity (i.e., the capacity argument to the constructor). | |
unsigned int | alloced_pages () const |
Returns the number of pages currently allocated. | |
unsigned int | free_pages () const |
Returns the number of pages currently free. | |
void | dump () const |
Dumps some state to stderr. | |
void | dumpNoFreeList () const |
|
Allocates capacity page-aligned blocks, each page_size bytes long, all locked into main memory (if locked). (One great big memalign call!) Throws an exception if unable to allocate and lock all that memory. page_size should generally be a power of two and multiple of the system page size. |
|
Destructor.
|
|
Allocates and returns a single page. Throws an exception if there are no free blocks left. |
|
Returns the number of pages currently allocated.
|
|
Returns the pool capacity (i.e., the capacity argument to the constructor).
|
|
Dumps some state to stderr.
|
|
|
|
Frees a page.
|
|
Returns the number of pages currently free.
|
|
Returns the page size for the pool (i.e., the page_size argument to the constructor).
|