RexxMemory.hpp File Reference
#include "SysSemaphore.hpp"
#include "IdentityTableClass.hpp"
#include "MemoryStats.hpp"
#include "MemorySegment.hpp"
Include dependency graph for RexxMemory.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MemorySegmentPoolHeader
 
class  MemorySegmentPool
 
class  RexxMemory
 

Macros

#define ObjectGrain   8
 
#define LargeAllocationUnit   1024
 
#define VeryLargeAllocationUnit   4096
 
#define VeryLargeObjectGrain   256
 
#define MinimumObjectSize   ((size_t)24)
 
#define MaximumObjectSize   ((size_t)0xfffffff0)
 
#define IsObjectGrained(o)   ((((size_t)o)%ObjectGrain) == 0)
 
#define IsValidSize(s)   ((s) >= MinimumObjectSize && ((s) % ObjectGrain) == 0)
 
#define setUpFlatten(type)
 
#define cleanUpFlatten    }
 
#define ObjectNeedsMarking(oref)   ((oref) != OREF_NULL && !((oref)->isObjectMarked(liveMark)) )
 
#define memory_mark(oref)   if (ObjectNeedsMarking(oref)) memoryObject.mark((RexxObject *)(oref))
 
#define memory_mark_general(oref)   (memoryObject.markGeneral((void *)&(oref)))
 
#define memory_mark_array(count, array)
 
#define memory_mark_general_array(count, array)
 
#define setUpFlatten(type)
 
#define cleanUpFlatten    }
 
#define flattenRef(oref)   if ((newThis->oref) != OREF_NULL) envelope->flattenReference((void *)&newThis, newSelf, (void *)&(newThis->oref))
 
#define flattenArrayRefs(count, array)
 
#define flatten_reference(oref, envel)   if (oref) envel->flattenReference((void *)&newThis, newSelf, (void *)&(oref))
 
#define CLASS_CREATE(name, id, className)   The##name##Class = (className *)new (sizeof(className), id, The##name##ClassBehaviour, The##name##Behaviour) RexxClass;
 

Typedefs

typedef char MEMORY_POOL_STATE
 

Enumerations

enum  {
  LIVEMARK , RESTORINGIMAGE , SAVINGIMAGE , FLATTENINGOBJECT ,
  UNFLATTENINGOBJECT
}
 

Functions

void SetObjectLive (void *o, size_t mark)
 
size_t roundObjectBoundary (size_t n)
 
size_t roundLargeObjectAllocation (size_t n)
 
size_t roundObjectResize (size_t n)
 
void saveObject (RexxInternalObject *o)
 
void discardObject (RexxInternalObject *o)
 
void holdObject (RexxInternalObject *o)
 
void discardHoldObject (RexxInternalObject *o)
 
RexxObjectnew_object (size_t s)
 
RexxObjectnew_object (size_t s, size_t t)
 
RexxArraynew_arrayOfObject (size_t s, size_t c, size_t t)
 

Macro Definition Documentation

◆ CLASS_CREATE

#define CLASS_CREATE (   name,
  id,
  className 
)    The##name##Class = (className *)new (sizeof(className), id, The##name##ClassBehaviour, The##name##Behaviour) RexxClass;

Definition at line 503 of file RexxMemory.hpp.

◆ cleanUpFlatten [1/2]

#define cleanUpFlatten    }

Definition at line 484 of file RexxMemory.hpp.

◆ cleanUpFlatten [2/2]

#define cleanUpFlatten    }

Definition at line 484 of file RexxMemory.hpp.

◆ flatten_reference

#define flatten_reference (   oref,
  envel 
)    if (oref) envel->flattenReference((void *)&newThis, newSelf, (void *)&(oref))

Definition at line 498 of file RexxMemory.hpp.

◆ flattenArrayRefs

#define flattenArrayRefs (   count,
  array 
)
Value:
for (size_t i = 0; i < count; i++) \
{ \
flattenRef(array[i]); \
}

Definition at line 491 of file RexxMemory.hpp.

◆ flattenRef

#define flattenRef (   oref)    if ((newThis->oref) != OREF_NULL) envelope->flattenReference((void *)&newThis, newSelf, (void *)&(newThis->oref))

Definition at line 488 of file RexxMemory.hpp.

◆ IsObjectGrained

#define IsObjectGrained (   o)    ((((size_t)o)%ObjectGrain) == 0)

Definition at line 92 of file RexxMemory.hpp.

◆ IsValidSize

#define IsValidSize (   s)    ((s) >= MinimumObjectSize && ((s) % ObjectGrain) == 0)

Definition at line 93 of file RexxMemory.hpp.

◆ LargeAllocationUnit

#define LargeAllocationUnit   1024

Definition at line 76 of file RexxMemory.hpp.

◆ MaximumObjectSize

#define MaximumObjectSize   ((size_t)0xfffffff0)

Definition at line 86 of file RexxMemory.hpp.

◆ memory_mark

#define memory_mark (   oref)    if (ObjectNeedsMarking(oref)) memoryObject.mark((RexxObject *)(oref))

Definition at line 450 of file RexxMemory.hpp.

◆ memory_mark_array

#define memory_mark_array (   count,
  array 
)
Value:
for (size_t i = 0; i < count; i++) \
{ \
memory_mark(array[i]); \
}

Definition at line 454 of file RexxMemory.hpp.

◆ memory_mark_general

#define memory_mark_general (   oref)    (memoryObject.markGeneral((void *)&(oref)))

Definition at line 451 of file RexxMemory.hpp.

◆ memory_mark_general_array

#define memory_mark_general_array (   count,
  array 
)
Value:
for (size_t i = 0; i < count; i++) \
{ \
memory_mark_general(array[i]); \
}

Definition at line 460 of file RexxMemory.hpp.

◆ MinimumObjectSize

#define MinimumObjectSize   ((size_t)24)

Definition at line 85 of file RexxMemory.hpp.

◆ ObjectGrain

#define ObjectGrain   8

Definition at line 74 of file RexxMemory.hpp.

◆ ObjectNeedsMarking

#define ObjectNeedsMarking (   oref)    ((oref) != OREF_NULL && !((oref)->isObjectMarked(liveMark)) )

Definition at line 449 of file RexxMemory.hpp.

◆ setUpFlatten [1/2]

#define setUpFlatten (   type)
Value:
{ \
size_t newSelf = envelope->currentOffset; \
type * volatile newThis = (type *)this;
int type
Definition: cmdparse.cpp:1888

Definition at line 478 of file RexxMemory.hpp.

◆ setUpFlatten [2/2]

#define setUpFlatten (   type)
Value:
{ \
size_t newSelf = envelope->currentOffset; \
type * volatile newThis = (type *)this;

Definition at line 478 of file RexxMemory.hpp.

◆ VeryLargeAllocationUnit

#define VeryLargeAllocationUnit   4096

Definition at line 78 of file RexxMemory.hpp.

◆ VeryLargeObjectGrain

#define VeryLargeObjectGrain   256

Definition at line 80 of file RexxMemory.hpp.

Typedef Documentation

◆ MEMORY_POOL_STATE

typedef char MEMORY_POOL_STATE

Definition at line 124 of file RexxMemory.hpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LIVEMARK 
RESTORINGIMAGE 
SAVINGIMAGE 
FLATTENINGOBJECT 
UNFLATTENINGOBJECT 

Definition at line 113 of file RexxMemory.hpp.

Function Documentation

◆ discardHoldObject()

void discardHoldObject ( RexxInternalObject o)
inline

Definition at line 433 of file RexxMemory.hpp.

References RexxMemory::discardHoldObject(), and memoryObject.

◆ discardObject()

void discardObject ( RexxInternalObject o)
inline

Definition at line 431 of file RexxMemory.hpp.

References RexxMemory::discardObject(), and memoryObject.

◆ holdObject()

void holdObject ( RexxInternalObject o)
inline

Definition at line 432 of file RexxMemory.hpp.

References RexxMemory::holdObject(), and memoryObject.

Referenced by ProtectedObject::~ProtectedObject().

◆ new_arrayOfObject()

RexxArray* new_arrayOfObject ( size_t  s,
size_t  c,
size_t  t 
)
inline

Definition at line 439 of file RexxMemory.hpp.

References memoryObject, and RexxMemory::newObjects().

Referenced by RexxClause::newToken(), and RexxClause::RexxClause().

◆ new_object() [1/2]

RexxObject* new_object ( size_t  s)
inline

Definition at line 436 of file RexxMemory.hpp.

References memoryObject, and RexxMemory::newObject().

Referenced by RexxInternalObject::clone(), RexxClass::createInstance(), RexxCompoundElement::newInstance(), RexxVariable::newInstance(), RexxInternalStack::newInstance(), RexxHashTable::newInstance(), RexxActivationFrameBuffer::newInstance(), RexxString::newString(), RexxString::newUpperString(), RexxMutableBuffer::operator new(), CommandHandler::operator new(), RexxNativeMethod::operator new(), RexxNativeRoutine::operator new(), RegisteredRoutine::operator new(), RexxSourceLiteral::operator new(), RexxBlock::operator new(), RexxContext::operator new(), RexxInteger::operator new(), RexxMessage::operator new(), RexxMethod::operator new(), RexxNilObject::operator new(), PackageClass::operator new(), RexxPointer::operator new(), RoutineClass::operator new(), StackFrameClass::operator new(), RexxStem::operator new(), RexxSupplier::operator new(), RexxText::operator new(), Unicode::operator new(), WeakReference::operator new(), RexxActivity::operator new(), CPPCode::operator new(), AttributeGetterCode::operator new(), AttributeSetterCode::operator new(), ConstantGetterCode::operator new(), AbstractCode::operator new(), RexxActivation::operator new(), RexxCode::operator new(), RexxNativeActivation::operator new(), SecurityManager::operator new(), RexxDotVariable::operator new(), RexxBinaryOperator::operator new(), RexxUnaryOperator::operator new(), RexxStemVariable::operator new(), RexxParseVariable::operator new(), RexxVariableReference::operator new(), ClassDirective::operator new(), RexxDoBlock::operator new(), ExtensionDirective::operator new(), LibraryDirective::operator new(), RequiresDirective::operator new(), RexxInstruction::operator new(), RexxEnvelope::operator new(), RexxSmartBuffer::operator new(), LibraryPackage::operator new(), RexxClause::operator new(), RexxSource::operator new(), RexxToken::operator new(), InterpreterInstance::operator new(), RexxTrigger::operator new(), RexxInternalObject::operator new(), RexxObject::operator new(), RexxBuffer::operator new(), RexxNumberString::operator new(), RexxSaveStack::operator new(), RexxListTable::operator new(), RexxCompoundVariable::operator new(), RexxExpressionFunction::operator new(), RexxExpressionList::operator new(), RexxExpressionLogical::operator new(), RexxExpressionMessage::operator new(), RexxStack::operator new(), RexxClass::operator new(), RexxArray::operator new(), RexxString::rawString(), and RexxSource::sourceNewObject().

◆ new_object() [2/2]

RexxObject* new_object ( size_t  s,
size_t  t 
)
inline

Definition at line 437 of file RexxMemory.hpp.

References memoryObject, and RexxMemory::newObject().

◆ roundLargeObjectAllocation()

size_t roundLargeObjectAllocation ( size_t  n)
inline

Definition at line 96 of file RexxMemory.hpp.

References LargeAllocationUnit, and RXROUNDUP.

Referenced by OldSpaceSegmentSet::allocateObject(), and RexxMemory::newObject().

◆ roundObjectBoundary()

◆ roundObjectResize()

size_t roundObjectResize ( size_t  n)
inline

Definition at line 97 of file RexxMemory.hpp.

References ObjectGrain, and RXROUNDUP.

Referenced by RexxMemory::reSize().

◆ saveObject()

void saveObject ( RexxInternalObject o)
inline

Definition at line 430 of file RexxMemory.hpp.

References memoryObject, and RexxMemory::saveObject().

◆ SetObjectLive()

void SetObjectLive ( void *  o,
size_t  mark 
)
inline

Definition at line 89 of file RexxMemory.hpp.