MemorySegmentSet Class Reference

#include <MemorySegment.hpp>

Inheritance diagram for MemorySegmentSet:
[legend]

Public Types

enum  SegmentSetID { SET_UNINITIALIZED , SET_NORMAL , SET_LARGEBLOCK , SET_OLDSPACE }
 

Public Member Functions

 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 void dumpMemoryProfile (FILE *outfile)
 
virtual DeadObjectdonateObject (size_t allocationLength)
 
virtual MemorySegmentdonateSegment (size_t allocationLength)
 

Protected Member Functions

virtual void collectEmptySegments ()
 
virtual void addDeadObject (DeadObject *object)
 
virtual void addDeadObject (char *object, size_t length)
 
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)
 
virtual size_t suggestMemoryExpansion ()
 
virtual size_t suggestMemoryContraction ()
 
virtual void prepareForSweep ()
 
virtual void completeSweepOperation ()
 
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)
 

Protected Attributes

MemorySegment anchor
 
MemorySegment emptySegments
 
size_t count
 
size_t liveObjectBytes
 
size_t deadObjectBytes
 
SegmentSetID owner
 
const char * name
 
RexxMemorymemory
 

Friends

class RexxMemory
 

Detailed Description

Definition at line 227 of file MemorySegment.hpp.

Member Enumeration Documentation

◆ SegmentSetID

Enumerator
SET_UNINITIALIZED 
SET_NORMAL 
SET_LARGEBLOCK 
SET_OLDSPACE 

Definition at line 231 of file MemorySegment.hpp.

Constructor & Destructor Documentation

◆ MemorySegmentSet() [1/2]

MemorySegmentSet::MemorySegmentSet ( RexxMemory memObject,
SegmentSetID  id,
const char *  setName 
)
inline

Definition at line 233 of file MemorySegment.hpp.

References count, memory, name, and owner.

◆ MemorySegmentSet() [2/2]

MemorySegmentSet::MemorySegmentSet ( )
inline

Definition at line 243 of file MemorySegment.hpp.

References count, memory, owner, and SET_UNINITIALIZED.

◆ ~MemorySegmentSet()

virtual MemorySegmentSet::~MemorySegmentSet ( )
inlinevirtual

Definition at line 251 of file MemorySegment.hpp.

Member Function Documentation

◆ activateEmptySegments()

void MemorySegmentSet::activateEmptySegments ( )
protected

◆ add()

void MemorySegmentSet::add ( MemorySegment segment)
inline

Definition at line 273 of file MemorySegment.hpp.

References anchor, count, and MemorySegment::insertBefore().

◆ addDeadObject() [1/2]

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

Reimplemented in NormalSegmentSet, LargeSegmentSet, and OldSpaceSegmentSet.

Definition at line 408 of file MemorySegment.cpp.

◆ addDeadObject() [2/2]

void MemorySegmentSet::addDeadObject ( DeadObject object)
protectedvirtual

◆ addSegment()

◆ addSegments()

void MemorySegmentSet::addSegments ( size_t  requiredSpace)
protected

◆ adjustMemorySize()

void MemorySegmentSet::adjustMemorySize ( )
protected

◆ allocateSegment()

MemorySegment * MemorySegmentSet::allocateSegment ( size_t  requestLength,
size_t  minimumLength 
)
protectedvirtual

Reimplemented in LargeSegmentSet.

Definition at line 249 of file MemorySegment.cpp.

References memory, and RexxMemory::newSegment().

Referenced by addSegments(), getSegment(), and newSegment().

◆ calculateSegmentAllocation()

size_t MemorySegmentSet::calculateSegmentAllocation ( size_t  n)
inlineprotected

Definition at line 346 of file MemorySegment.hpp.

References MemorySegmentOverhead, roundSegmentBoundary(), and SegmentSize.

Referenced by addSegments().

◆ collectEmptySegments()

void MemorySegmentSet::collectEmptySegments ( )
protectedvirtual

Definition at line 1181 of file MemorySegment.cpp.

◆ combineEmptySegments()

◆ completeSweepOperation()

void MemorySegmentSet::completeSweepOperation ( )
protectedvirtual

Reimplemented in NormalSegmentSet, and LargeSegmentSet.

Definition at line 1046 of file MemorySegment.cpp.

Referenced by sweep().

◆ donateObject()

DeadObject * MemorySegmentSet::donateObject ( size_t  allocationLength)
virtual

Reimplemented in NormalSegmentSet, and LargeSegmentSet.

Definition at line 518 of file MemorySegment.cpp.

Referenced by RexxMemory::scavengeSegmentSets().

◆ donateSegment()

MemorySegment * MemorySegmentSet::donateSegment ( size_t  allocationLength)
virtual

Definition at line 558 of file MemorySegment.cpp.

References findEmptySegment(), and splitSegment().

Referenced by RexxMemory::scavengeSegmentSets().

◆ dumpMemoryProfile()

void MemorySegmentSet::dumpMemoryProfile ( FILE *  outfile)
virtual

Reimplemented in NormalSegmentSet, and LargeSegmentSet.

Definition at line 134 of file MemorySegment.cpp.

◆ dumpSegments()

void MemorySegmentSet::dumpSegments ( FILE *  keyfile,
FILE *  dumpfile 
)

Definition at line 120 of file MemorySegment.cpp.

References MemorySegment::dump(), first(), name, and next().

Referenced by RexxMemory::dump().

◆ findEmptySegment()

MemorySegment * MemorySegmentSet::findEmptySegment ( size_t  allocationLength)
protected

◆ first()

◆ freeMemoryPercentage()

float MemorySegmentSet::freeMemoryPercentage ( )
inlineprotected

◆ gatherStats()

◆ getSegment()

MemorySegment * MemorySegmentSet::getSegment ( size_t  requestLength,
size_t  minimumLength 
)
protected

Definition at line 267 of file MemorySegment.cpp.

References allocateSegment(), and findEmptySegment().

◆ insertSegment()

void MemorySegmentSet::insertSegment ( MemorySegment segment)
protected

◆ is()

bool MemorySegmentSet::is ( SegmentSetID  id)
inline

Definition at line 311 of file MemorySegment.hpp.

References owner.

Referenced by RexxMemory::scavengeSegmentSets().

◆ isInSegmentSet()

bool MemorySegmentSet::isInSegmentSet ( RexxObject object)
inline

Definition at line 296 of file MemorySegment.hpp.

References first(), MemorySegment::isInSegment(), and next().

Referenced by RexxMemory::inSharedObjectStorage().

◆ largestActiveSegment()

MemorySegment * MemorySegmentSet::largestActiveSegment ( )
protected

◆ largestEmptySegment()

MemorySegment * MemorySegmentSet::largestEmptySegment ( )
protected

◆ mergeSegments()

◆ newSegment()

bool MemorySegmentSet::newSegment ( size_t  requestLength,
size_t  minimumLength 
)
protected

◆ next()

◆ operator delete() [1/2]

void MemorySegmentSet::operator delete ( void *  size)
inline

Definition at line 253 of file MemorySegment.hpp.

◆ operator delete() [2/2]

void MemorySegmentSet::operator delete ( void *  size,
void *  segment 
)
inline

Definition at line 254 of file MemorySegment.hpp.

◆ operator new()

void* MemorySegmentSet::operator new ( size_t  size,
void *  segment 
)
inline

Definition at line 252 of file MemorySegment.hpp.

◆ prepareForSweep()

void MemorySegmentSet::prepareForSweep ( )
protectedvirtual

◆ releaseEmptySegments()

void MemorySegmentSet::releaseEmptySegments ( size_t  releaseSize)
protected

◆ releaseSegment()

void MemorySegmentSet::releaseSegment ( MemorySegment segment)
protected

Definition at line 947 of file MemorySegment.cpp.

References count, emptySegments, and MemorySegment::insertBefore().

Referenced by releaseEmptySegments().

◆ removeSegment()

void MemorySegmentSet::removeSegment ( MemorySegment segment)
inline

Definition at line 259 of file MemorySegment.hpp.

References count, and MemorySegment::remove().

Referenced by combineEmptySegments(), mergeSegments(), and splitSegment().

◆ removeSegmentAndStorage()

void MemorySegmentSet::removeSegmentAndStorage ( MemorySegment segment)
inline

Definition at line 266 of file MemorySegment.hpp.

References count, and MemorySegment::removeAll().

Referenced by releaseEmptySegments().

◆ splitDeadObject()

RexxObject * MemorySegmentSet::splitDeadObject ( DeadObject object,
size_t  allocationLength,
size_t  splitMinimum 
)
protected

◆ splitSegment()

◆ suggestMemoryContraction()

size_t MemorySegmentSet::suggestMemoryContraction ( )
protectedvirtual

Reimplemented in NormalSegmentSet.

Definition at line 831 of file MemorySegment.cpp.

◆ suggestMemoryExpansion()

size_t MemorySegmentSet::suggestMemoryExpansion ( )
protectedvirtual

Reimplemented in NormalSegmentSet.

Definition at line 817 of file MemorySegment.cpp.

Referenced by adjustMemorySize().

◆ sweep()

◆ totalFreeMemory()

size_t MemorySegmentSet::totalFreeMemory ( )
inlineprotected

Definition at line 343 of file MemorySegment.hpp.

References deadObjectBytes, and liveObjectBytes.

Referenced by NormalSegmentSet::suggestMemoryContraction().

◆ validateObject()

void MemorySegmentSet::validateObject ( size_t  bytes)
inlineprotected

Definition at line 361 of file MemorySegment.hpp.

Referenced by sweep().

Friends And Related Function Documentation

◆ RexxMemory

friend class RexxMemory
friend

Definition at line 228 of file MemorySegment.hpp.

Member Data Documentation

◆ anchor

MemorySegment MemorySegmentSet::anchor
protected

Definition at line 368 of file MemorySegment.hpp.

Referenced by add(), addSegment(), first(), largestActiveSegment(), and mergeSegments().

◆ count

size_t MemorySegmentSet::count
protected

◆ deadObjectBytes

size_t MemorySegmentSet::deadObjectBytes
protected

◆ emptySegments

MemorySegment MemorySegmentSet::emptySegments
protected

◆ liveObjectBytes

◆ memory

◆ name

const char* MemorySegmentSet::name
protected

Definition at line 374 of file MemorySegment.hpp.

Referenced by dumpSegments(), and MemorySegmentSet().

◆ owner

SegmentSetID MemorySegmentSet::owner
protected

Definition at line 373 of file MemorySegment.hpp.

Referenced by is(), and MemorySegmentSet().


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