rambrain
rambrain::managedMemoryChunk Class Reference

manages all managed Chunks of raw memory More...

#include <managedMemoryChunk.h>

Public Member Functions

 managedMemoryChunk (const memoryID &parent, const memoryID &me)
 
 managedMemoryChunk (const memoryID &me)
 

Public Attributes

memoryStatus status
 
unsigned short useCnt
 Number of using adhereTos or a possible location for locking the object to changes. More...
 
void * locPtr
 pointer to the actual data in RAM More...
 
global_bytesize size
 Size of actual object in bytes. More...
 
memoryID id
 an ID to identify the object in scheduler or elsewhere More...
 
memoryID parent
 parent element if created in class hierarchy More...
 
memoryID next
 next element More...
 
memoryID child
 first child element if creating a class hierarchy More...
 
bool preemptiveLoaded = false
 
void * schedBuf
 a place to store additional scheduling information More...
 
void * swapBuf
 a place to store additional swapping information More...
 

Detailed Description

manages all managed Chunks of raw memory

This object tracks the dimesions and status of a chunk of memory we manage. The status is inherently connected to the logic we can operate on the object and it is basically prescribed what classes may change the status from wich state to which. Even though it would be more clear to have convenience and thread-safe functions here, we decided for this due to performance issues. More documentation to come. The basically possible transitions are depicted in the following graph:

dot_chunkStatusScheme.png

Note
when changing status, you have to hold the stateChangeMutex of the associated memoryManager
Warning
There may be changes to any objects status when calling waiting functions in managedMemory or managedSwap. Thus the user has to check the status of the object again having called such functions or having freshly acquired the lock

Definition at line 54 of file managedMemoryChunk.h.

Constructor & Destructor Documentation

rambrain::managedMemoryChunk::managedMemoryChunk ( const memoryID parent,
const memoryID me 
)

Definition at line 27 of file managedMemoryChunk.cpp.

rambrain::managedMemoryChunk::managedMemoryChunk ( const memoryID me)

Definition at line 32 of file managedMemoryChunk.cpp.

Member Data Documentation

memoryID rambrain::managedMemoryChunk::child

first child element if creating a class hierarchy

Definition at line 74 of file managedMemoryChunk.h.

memoryID rambrain::managedMemoryChunk::id

an ID to identify the object in scheduler or elsewhere

Definition at line 70 of file managedMemoryChunk.h.

void* rambrain::managedMemoryChunk::locPtr

pointer to the actual data in RAM

Definition at line 66 of file managedMemoryChunk.h.

memoryID rambrain::managedMemoryChunk::next

next element

Definition at line 73 of file managedMemoryChunk.h.

memoryID rambrain::managedMemoryChunk::parent

parent element if created in class hierarchy

Definition at line 72 of file managedMemoryChunk.h.

bool rambrain::managedMemoryChunk::preemptiveLoaded = false

Definition at line 76 of file managedMemoryChunk.h.

void* rambrain::managedMemoryChunk::schedBuf

a place to store additional scheduling information

Definition at line 79 of file managedMemoryChunk.h.

global_bytesize rambrain::managedMemoryChunk::size

Size of actual object in bytes.

Definition at line 67 of file managedMemoryChunk.h.

memoryStatus rambrain::managedMemoryChunk::status

Definition at line 64 of file managedMemoryChunk.h.

void* rambrain::managedMemoryChunk::swapBuf

a place to store additional swapping information

Definition at line 82 of file managedMemoryChunk.h.

unsigned short rambrain::managedMemoryChunk::useCnt

Number of using adhereTos or a possible location for locking the object to changes.

Definition at line 65 of file managedMemoryChunk.h.


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