NormalSegmentSet Class Reference

#include <MemorySegment.hpp>

Inheritance diagram for NormalSegmentSet:
[legend]

Public Member Functions

 NormalSegmentSet ()
 
 NormalSegmentSet (RexxMemory *memory)
 
virtual ~NormalSegmentSet ()
 
virtual void dumpMemoryProfile (FILE *outfile)
 
RexxObjectallocateObject (size_t allocationLength)
 
RexxObjecthandleAllocationFailure (size_t allocationLength)
 
virtual DeadObjectdonateObject (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)
 
MemorySegmentfirst ()
 
MemorySegmentnext (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 MemorySegmentdonateSegment (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 ()
 
RexxObjectsplitDeadObject (DeadObject *object, size_t allocationLength, size_t splitMinimum)
 
void insertSegment (MemorySegment *segment)
 
MemorySegmentfindEmptySegment (size_t allocationLength)
 
MemorySegmentsplitSegment (size_t allocationLength)
 
void mergeSegments (size_t allocationLength)
 
void combineEmptySegments (MemorySegment *front, MemorySegment *back)
 
MemorySegmentlargestActiveSegment ()
 
MemorySegmentlargestEmptySegment ()
 
void adjustMemorySize ()
 
void releaseEmptySegments (size_t releaseSize)
 
void releaseSegment (MemorySegment *segment)
 
bool newSegment (size_t requestLength, size_t minimumLength)
 
virtual MemorySegmentallocateSegment (size_t requestLength, size_t minimumLength)
 
float freeMemoryPercentage ()
 
size_t totalFreeMemory ()
 
size_t calculateSegmentAllocation (size_t n)
 
void addSegments (size_t requiredSpace)
 
MemorySegmentgetSegment (size_t requestLength, size_t minimumLength)
 
void activateEmptySegments ()
 
void validateObject (size_t bytes)
 

Private Member Functions

size_t mapLengthToDeadPool (size_t length)
 
RexxObjectfindLargeDeadObject (size_t allocationLength)
 
size_t recommendedMemorySize ()
 
size_t recommendedMaximumMemorySize ()
 
void checkObjectOverlap (DeadObject *obj)
 
RexxObjectfindObject (size_t allocationLength)
 
RexxObjectsplitNormalDeadObject (DeadObject *object, size_t allocationLength, size_t deadLength)
 

Private Attributes

DeadObjectPool largeDead
 
DeadObjectPool subpools [DeadPools]
 
size_t lastUsedSubpool [DeadPools+1]
 
MemorySegmentrecoverSegment
 

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
 
RexxMemorymemory
 

Detailed Description

Definition at line 379 of file MemorySegment.hpp.

Constructor & Destructor Documentation

◆ NormalSegmentSet() [1/2]

NormalSegmentSet::NormalSegmentSet ( )
inline

Definition at line 384 of file MemorySegment.hpp.

◆ NormalSegmentSet() [2/2]

◆ ~NormalSegmentSet()

virtual NormalSegmentSet::~NormalSegmentSet ( )
inlinevirtual

Definition at line 386 of file MemorySegment.hpp.

Member Function Documentation

◆ addDeadObject() [1/2]

void NormalSegmentSet::addDeadObject ( char *  object,
size_t  length 
)
protectedvirtual

◆ addDeadObject() [2/2]

void NormalSegmentSet::addDeadObject ( DeadObject object)
protectedvirtual

◆ allocateObject()

◆ checkObjectOverlap()

void NormalSegmentSet::checkObjectOverlap ( DeadObject obj)
private

◆ completeSweepOperation()

void NormalSegmentSet::completeSweepOperation ( )
protectedvirtual

Reimplemented from MemorySegmentSet.

Definition at line 1054 of file MemorySegment.cpp.

References DeadPools, FirstDeadPool, lastUsedSubpool, and subpools.

◆ donateObject()

DeadObject * NormalSegmentSet::donateObject ( size_t  allocationLength)
virtual

Reimplemented from MemorySegmentSet.

Definition at line 530 of file MemorySegment.cpp.

References findLargeDeadObject().

◆ dumpMemoryProfile()

void NormalSegmentSet::dumpMemoryProfile ( FILE *  outfile)
virtual

◆ findLargeDeadObject()

RexxObject * NormalSegmentSet::findLargeDeadObject ( size_t  allocationLength)
private

◆ findObject()

RexxObject * NormalSegmentSet::findObject ( size_t  allocationLength)
private

Definition at line 1252 of file MemorySegment.cpp.

References allocateObject().

Referenced by handleAllocationFailure().

◆ getInitialSet()

void NormalSegmentSet::getInitialSet ( )

◆ handleAllocationFailure()

◆ mapLengthToDeadPool()

size_t NormalSegmentSet::mapLengthToDeadPool ( size_t  length)
inlineprivate

Definition at line 489 of file MemorySegment.hpp.

References ObjectGrain.

◆ prepareForSweep()

void NormalSegmentSet::prepareForSweep ( )
protectedvirtual

◆ recommendedMaximumMemorySize()

size_t NormalSegmentSet::recommendedMaximumMemorySize ( )
inlineprivate

◆ recommendedMemorySize()

size_t NormalSegmentSet::recommendedMemorySize ( )
inlineprivate

◆ splitNormalDeadObject()

RexxObject* NormalSegmentSet::splitNormalDeadObject ( DeadObject object,
size_t  allocationLength,
size_t  deadLength 
)
inlineprivate

◆ suggestMemoryContraction()

size_t NormalSegmentSet::suggestMemoryContraction ( )
virtual

◆ suggestMemoryExpansion()

Member Data Documentation

◆ largeDead

◆ lastUsedSubpool

size_t NormalSegmentSet::lastUsedSubpool[DeadPools+1]
private

◆ recoverSegment

MemorySegment* NormalSegmentSet::recoverSegment
private

Definition at line 535 of file MemorySegment.hpp.

Referenced by handleAllocationFailure(), and NormalSegmentSet().

◆ subpools


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