#include <MemorySegment.hpp>
Public Member Functions | |
NormalSegmentSet () | |
NormalSegmentSet (RexxMemory *memory) | |
virtual | ~NormalSegmentSet () |
virtual void | dumpMemoryProfile (FILE *outfile) |
RexxObject * | allocateObject (size_t allocationLength) |
RexxObject * | handleAllocationFailure (size_t allocationLength) |
virtual DeadObject * | donateObject (size_t allocationLength) |
void | getInitialSet () |
virtual size_t | suggestMemoryExpansion () |
virtual size_t | suggestMemoryContraction () |
Public Member Functions inherited from MemorySegmentSet | |
MemorySegmentSet (RexxMemory *memObject, SegmentSetID id, const char *setName) | |
MemorySegmentSet () | |
virtual | ~MemorySegmentSet () |
void * | operator new (size_t size, void *segment) |
void | operator delete (void *size) |
void | operator delete (void *size, void *segment) |
void | removeSegment (MemorySegment *segment) |
void | removeSegmentAndStorage (MemorySegment *segment) |
void | add (MemorySegment *segment) |
MemorySegment * | first () |
MemorySegment * | next (MemorySegment *segment) |
bool | isInSegmentSet (RexxObject *object) |
void | dumpSegments (FILE *keyfile, FILE *dumpfile) |
void | addSegment (MemorySegment *segment, bool createDeadObject=1) |
void | sweep () |
bool | is (SegmentSetID id) |
void | gatherStats (MemoryStats *memStats, SegmentStats *stats) |
virtual MemorySegment * | donateSegment (size_t allocationLength) |
Protected Member Functions | |
virtual void | addDeadObject (DeadObject *object) |
virtual void | addDeadObject (char *object, size_t length) |
virtual void | prepareForSweep () |
void | completeSweepOperation () |
Protected Member Functions inherited from MemorySegmentSet | |
virtual void | collectEmptySegments () |
RexxObject * | splitDeadObject (DeadObject *object, size_t allocationLength, size_t splitMinimum) |
void | insertSegment (MemorySegment *segment) |
MemorySegment * | findEmptySegment (size_t allocationLength) |
MemorySegment * | splitSegment (size_t allocationLength) |
void | mergeSegments (size_t allocationLength) |
void | combineEmptySegments (MemorySegment *front, MemorySegment *back) |
MemorySegment * | largestActiveSegment () |
MemorySegment * | largestEmptySegment () |
void | adjustMemorySize () |
void | releaseEmptySegments (size_t releaseSize) |
void | releaseSegment (MemorySegment *segment) |
bool | newSegment (size_t requestLength, size_t minimumLength) |
virtual MemorySegment * | allocateSegment (size_t requestLength, size_t minimumLength) |
float | freeMemoryPercentage () |
size_t | totalFreeMemory () |
size_t | calculateSegmentAllocation (size_t n) |
void | addSegments (size_t requiredSpace) |
MemorySegment * | getSegment (size_t requestLength, size_t minimumLength) |
void | activateEmptySegments () |
void | validateObject (size_t bytes) |
Private Member Functions | |
size_t | mapLengthToDeadPool (size_t length) |
RexxObject * | findLargeDeadObject (size_t allocationLength) |
size_t | recommendedMemorySize () |
size_t | recommendedMaximumMemorySize () |
void | checkObjectOverlap (DeadObject *obj) |
RexxObject * | findObject (size_t allocationLength) |
RexxObject * | splitNormalDeadObject (DeadObject *object, size_t allocationLength, size_t deadLength) |
Private Attributes | |
DeadObjectPool | largeDead |
DeadObjectPool | subpools [DeadPools] |
size_t | lastUsedSubpool [DeadPools+1] |
MemorySegment * | recoverSegment |
Additional Inherited Members | |
Public Types inherited from MemorySegmentSet | |
enum | SegmentSetID { SET_UNINITIALIZED , SET_NORMAL , SET_LARGEBLOCK , SET_OLDSPACE } |
Protected Attributes inherited from MemorySegmentSet | |
MemorySegment | anchor |
MemorySegment | emptySegments |
size_t | count |
size_t | liveObjectBytes |
size_t | deadObjectBytes |
SegmentSetID | owner |
const char * | name |
RexxMemory * | memory |
Definition at line 379 of file MemorySegment.hpp.
|
inline |
Definition at line 384 of file MemorySegment.hpp.
NormalSegmentSet::NormalSegmentSet | ( | RexxMemory * | memory | ) |
Definition at line 207 of file MemorySegment.cpp.
References DeadPools, DeadPoolToLength, DeadObjectPool::emptySingle(), lastUsedSubpool, MemorySegmentSet::memory, RexxMemory::newSegment(), recoverSegment, RecoverSegmentSize, DeadObjectPool::setID(), and subpools.
|
inlinevirtual |
Definition at line 386 of file MemorySegment.hpp.
|
protectedvirtual |
Reimplemented from MemorySegmentSet.
Definition at line 447 of file MemorySegment.cpp.
References DeadObjectPool::add(), DeadObjectPool::addSingle(), largeDead, LargestSubpool, lastUsedSubpool, LengthToDeadPool, and subpools.
|
protectedvirtual |
Reimplemented from MemorySegmentSet.
Definition at line 379 of file MemorySegment.cpp.
References DeadObjectPool::add(), DeadObjectPool::addSingle(), largeDead, LargestSubpool, lastUsedSubpool, LengthToDeadPool, and subpools.
|
inline |
Definition at line 388 of file MemorySegment.hpp.
References DeadPools, DeadObjectPool::findFit(), DeadObjectPool::getFirstSingle(), largeDead, lastUsedSubpool, LengthToDeadPool, MinimumObjectSize, OREF_NULL, splitNormalDeadObject(), and subpools.
Referenced by findObject(), RexxMemory::newObject(), and RexxMemory::newObjects().
|
private |
Definition at line 170 of file MemorySegment.cpp.
References DeadObjectPool::checkObjectOverlap(), DeadPools, FirstDeadPool, largeDead, and subpools.
|
protectedvirtual |
Reimplemented from MemorySegmentSet.
Definition at line 1054 of file MemorySegment.cpp.
References DeadPools, FirstDeadPool, lastUsedSubpool, and subpools.
|
virtual |
Reimplemented from MemorySegmentSet.
Definition at line 530 of file MemorySegment.cpp.
References findLargeDeadObject().
|
virtual |
Reimplemented from MemorySegmentSet.
Definition at line 153 of file MemorySegment.cpp.
References DeadPools, DeadObjectPool::dumpMemoryProfile(), FirstDeadPool, largeDead, and subpools.
Referenced by RexxMemory::dumpMemoryProfile().
|
private |
Definition at line 1230 of file MemorySegment.cpp.
References DeadObjectPool::findFit(), largeDead, MinimumObjectSize, OREF_NULL, and MemorySegmentSet::splitDeadObject().
Referenced by donateObject().
|
private |
Definition at line 1252 of file MemorySegment.cpp.
References allocateObject().
Referenced by handleAllocationFailure().
void NormalSegmentSet::getInitialSet | ( | ) |
Definition at line 239 of file MemorySegment.cpp.
References MemorySegmentSet::addSegments(), and InitialNormalSegmentSpace.
Referenced by RexxMemory::initialize().
RexxObject * NormalSegmentSet::handleAllocationFailure | ( | size_t | allocationLength | ) |
Definition at line 1263 of file MemorySegment.cpp.
References MemorySegmentSet::addSegment(), MemorySegmentSet::addSegments(), MemorySegmentSet::adjustMemorySize(), RexxMemory::collect(), Error_System_resources, findObject(), MemorySegmentSet::memory, OREF_NULL, recoverSegment, reportException(), RexxMemory::scavengeSegmentSets(), and SegmentSize.
Referenced by RexxMemory::newObject(), and RexxMemory::newObjects().
|
inlineprivate |
Definition at line 489 of file MemorySegment.hpp.
References ObjectGrain.
|
protectedvirtual |
Reimplemented from MemorySegmentSet.
Definition at line 1013 of file MemorySegment.cpp.
References DeadPools, DeadObjectPool::empty(), DeadObjectPool::emptySingle(), FirstDeadPool, largeDead, MemorySegmentSet::prepareForSweep(), and subpools.
|
inlineprivate |
Definition at line 492 of file MemorySegment.hpp.
References MemorySegmentSet::liveObjectBytes, and NormalMemoryContractionThreshold.
Referenced by suggestMemoryContraction().
|
inlineprivate |
Definition at line 491 of file MemorySegment.hpp.
References MemorySegmentSet::liveObjectBytes, and NormalMemoryExpansionThreshold.
Referenced by suggestMemoryExpansion().
|
inlineprivate |
Definition at line 495 of file MemorySegment.hpp.
References DeadObjectPool::add(), DeadObjectPool::addSingle(), largeDead, LargestSubpool, lastUsedSubpool, LengthToDeadPool, and subpools.
Referenced by allocateObject().
|
virtual |
Reimplemented from MemorySegmentSet.
Definition at line 844 of file MemorySegment.cpp.
References MemorySegmentSet::freeMemoryPercentage(), InitialNormalSegmentSpace, NormalMemoryContractionThreshold, recommendedMaximumMemorySize(), and MemorySegmentSet::totalFreeMemory().
|
virtual |
Reimplemented from MemorySegmentSet.
Definition at line 786 of file MemorySegment.cpp.
References MemorySegmentSet::deadObjectBytes, MemorySegmentSet::freeMemoryPercentage(), MemorySegmentSet::liveObjectBytes, MemorySegmentSet::memory, NormalMemoryExpansionThreshold, recommendedMemorySize(), and RexxMemory::verboseMessage().
|
private |
Definition at line 532 of file MemorySegment.hpp.
Referenced by addDeadObject(), allocateObject(), checkObjectOverlap(), dumpMemoryProfile(), findLargeDeadObject(), prepareForSweep(), and splitNormalDeadObject().
|
private |
Definition at line 534 of file MemorySegment.hpp.
Referenced by addDeadObject(), allocateObject(), completeSweepOperation(), NormalSegmentSet(), and splitNormalDeadObject().
|
private |
Definition at line 535 of file MemorySegment.hpp.
Referenced by handleAllocationFailure(), and NormalSegmentSet().
|
private |
Definition at line 533 of file MemorySegment.hpp.
Referenced by addDeadObject(), allocateObject(), checkObjectOverlap(), completeSweepOperation(), dumpMemoryProfile(), NormalSegmentSet(), prepareForSweep(), and splitNormalDeadObject().