|
rambrain
|
Class that serves as a backend to managedMemory to actual write/read managedMemoryChunks to/from hard disk or other non random access memory. More...
#include <managedSwap.h>
Public Member Functions | |
| managedSwap (global_bytesize size) | |
| virtual | ~managedSwap () |
| virtual global_bytesize | swapOut (managedMemoryChunk **chunklist, unsigned int nchunks)=0 |
| Trigger swap out of the chunks pointed to by chunklist. More... | |
| virtual global_bytesize | swapOut (managedMemoryChunk *chunk)=0 |
| Trigger swap out of the chunk pointed to by chunk. More... | |
| virtual global_bytesize | swapIn (managedMemoryChunk **chunklist, unsigned int nchunks)=0 |
| Trigger swap in of the chunks pointed to by chunklist. More... | |
| virtual global_bytesize | swapIn (managedMemoryChunk *chunk)=0 |
| Trigger swap in of the chunk pointed to by chunk. More... | |
| virtual void | swapDelete (managedMemoryChunk *chunk)=0 |
| Mark chunk as deleted. More... | |
| virtual bool | extendSwapByPolicy (global_bytesize min_size) |
| extend swap by policy More... | |
| virtual bool | extendSwap (global_bytesize size) |
| extend swap by size number of bytes More... | |
| virtual global_bytesize | getSwapSize () const |
| Simple getter. More... | |
| virtual global_bytesize | getUsedSwap () const |
| Simple getter. More... | |
| virtual global_bytesize | getFreeSwap () const |
| Simple getter. More... | |
| virtual swapPolicy | getSwapPolicy () const |
| virtual swapPolicy | setSwapPolicy (swapPolicy newPolicy) |
| size_t | getMemoryAlignment () const |
| Returns possible memory alignment restrictions. More... | |
| void | claimUsageof (global_bytesize bytes, bool rambytes, bool used) |
| account for memory usage change More... | |
| void | waitForCleanExit () |
| Function waits for all asynchronous IO to complete. The wait is implemented non-performant as a normal user does not have to wait for this. Implementing this with a _cond just destroys performance in the respective swapIn/out procedures without increasing any user space functionality. More... | |
| virtual bool | checkForAIO () |
| virtual void | close ()=0 |
| Close the swap if not already closed. More... | |
| virtual bool | cleanupCachedElements (rambrain::global_bytesize minimum_size=0) |
| throws out cached elements still in ram but also resident on disk. This makes space in situations of low swap memory More... | |
| virtual void | invalidateCacheFor (managedMemoryChunk &chunk) |
| tells managedFileSwap that the chunk under consideration might have been changed by user and needs to be copied out freshly More... | |
Protected Attributes | |
| global_bytesize | swapSize |
| global_bytesize | swapUsed |
| global_bytesize | swapFree |
| unsigned int | totalSwapActionsQueued = 0 |
| size_t | memoryAlignment = 1 |
| swapPolicy | policy = swapPolicy::fixed |
| bool | closed = false |
Class that serves as a backend to managedMemory to actual write/read managedMemoryChunks to/from hard disk or other non random access memory.
Definition at line 35 of file managedSwap.h.
| rambrain::managedSwap::managedSwap | ( | global_bytesize | size | ) |
Definition at line 26 of file managedSwap.cpp.
|
virtual |
Definition at line 30 of file managedSwap.cpp.
|
inlinevirtual |
Reimplemented in rambrain::managedFileSwap.
Definition at line 122 of file managedSwap.h.
| void rambrain::managedSwap::claimUsageof | ( | global_bytesize | bytes, |
| bool | rambytes, | ||
| bool | used | ||
| ) |
account for memory usage change
| bytes | number of bytes under consideration |
| rambytes | set this to true if you want to signal different usage for bytes residing in rambytes |
| used | sum of bytes will be increased if true, else decreased. |
Definition at line 35 of file managedSwap.cpp.
|
inlinevirtual |
throws out cached elements still in ram but also resident on disk. This makes space in situations of low swap memory
Reimplemented in rambrain::managedFileSwap.
Definition at line 137 of file managedSwap.h.
|
pure virtual |
Close the swap if not already closed.
Implemented in rambrain::managedFileSwap, and rambrain::managedDummySwap.
|
inlinevirtual |
extend swap by size number of bytes
Reimplemented in rambrain::managedFileSwap.
Definition at line 76 of file managedSwap.h.
|
inlinevirtual |
extend swap by policy
| min_size | Minimum size the swap has to be extended before success is returned |
Reimplemented in rambrain::managedFileSwap.
Definition at line 69 of file managedSwap.h.
|
inlinevirtual |
Simple getter.
Definition at line 90 of file managedSwap.h.
|
inline |
Returns possible memory alignment restrictions.
Definition at line 107 of file managedSwap.h.
|
inlinevirtual |
Definition at line 95 of file managedSwap.h.
|
inlinevirtual |
Simple getter.
Definition at line 82 of file managedSwap.h.
|
inlinevirtual |
Simple getter.
Definition at line 86 of file managedSwap.h.
|
inlinevirtual |
tells managedFileSwap that the chunk under consideration might have been changed by user and needs to be copied out freshly
Reimplemented in rambrain::managedFileSwap.
Definition at line 143 of file managedSwap.h.
|
inlinevirtual |
Definition at line 100 of file managedSwap.h.
|
pure virtual |
Mark chunk as deleted.
Implemented in rambrain::managedFileSwap, and rambrain::managedDummySwap.
|
pure virtual |
Trigger swap in of the chunks pointed to by chunklist.
Implemented in rambrain::managedFileSwap, and rambrain::managedDummySwap.
|
pure virtual |
Trigger swap in of the chunk pointed to by chunk.
Implemented in rambrain::managedFileSwap, and rambrain::managedDummySwap.
|
pure virtual |
Trigger swap out of the chunks pointed to by chunklist.
Implemented in rambrain::managedFileSwap, and rambrain::managedDummySwap.
|
pure virtual |
Trigger swap out of the chunk pointed to by chunk.
Implemented in rambrain::managedFileSwap, and rambrain::managedDummySwap.
| void rambrain::managedSwap::waitForCleanExit | ( | ) |
Function waits for all asynchronous IO to complete. The wait is implemented non-performant as a normal user does not have to wait for this. Implementing this with a _cond just destroys performance in the respective swapIn/out procedures without increasing any user space functionality.
Definition at line 46 of file managedSwap.cpp.
|
protected |
Definition at line 155 of file managedSwap.h.
|
protected |
Definition at line 151 of file managedSwap.h.
|
protected |
Definition at line 153 of file managedSwap.h.
|
protected |
Definition at line 148 of file managedSwap.h.
|
protected |
Definition at line 146 of file managedSwap.h.
|
protected |
Definition at line 147 of file managedSwap.h.
|
protected |
Definition at line 149 of file managedSwap.h.