ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

RexxMemory.hpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel RexxMemory.hpp */
40 /* */
41 /* Primitive Memory Class Definitions */
42 /* */
43 /******************************************************************************/
44 
45 #ifndef Included_RexxMemory
46 #define Included_RexxMemory
47 
48 #include "SysSemaphore.hpp"
49 #include "IdentityTableClass.hpp"
50 
51 // this can be enabled to switch on memory profiling info
52 //#define MEMPROFILE
53 
54 #ifdef __REXX64__
55 // The minimum allocation unit for an object.
56 // 16 is needed for 64-bit to maintain some required alignments
57 #define ObjectGrain 16
58 /* The unit of granularity for large allocation */
59 #define LargeAllocationUnit 2048
60 /* The unit of granularity for extremely large objects */
61 #define VeryLargeAllocationUnit 8192
62 /* Minimum size of an object. This is not the actual minimum size, */
63 /* but we allocate objects with an 8-byte granularity */
64 /* this is the granularity for objects greater than 16Mb. */
65 #define VeryLargeObjectGrain 512
66 
67 /* Minimum size of an object. This is not the actual minimum size, */
68 /* but we allocate objects with a defined granularity */
69 /* This is the smallest object we'll allocate from storage. */
70 #define MinimumObjectSize ((size_t)48)
71 #define MaximumObjectSize ((size_t)0xfffffffffffffff0ull)
72 #else
73 /* The minimum allocation unit for an object. */
74 #define ObjectGrain 8
75 /* The unit of granularity for large allocation */
76 #define LargeAllocationUnit 1024
77 /* The unit of granularity for extremely large objects */
78 #define VeryLargeAllocationUnit 4096
79 /* this is the granularity for objects greater than 16Mb. */
80 #define VeryLargeObjectGrain 256
81 
82 /* Minimum size of an object. This is not the actual minimum size, */
83 /* but we allocate objects with an 8-byte granularity */
84 /* This is the smallest object we'll allocate from storage. */
85 #define MinimumObjectSize ((size_t)24)
86 #define MaximumObjectSize ((size_t)0xfffffff0)
87 #endif
88 
89 inline void SetObjectLive(void *o, size_t mark) {
90  ((RexxObject *)o)->setObjectLive(mark);
91 }
92 #define IsObjectGrained(o) ((((size_t)o)%ObjectGrain) == 0)
93 #define IsValidSize(s) ((s) >= MinimumObjectSize && ((s) % ObjectGrain) == 0)
94 
95 inline size_t roundObjectBoundary(size_t n) { return RXROUNDUP(n,ObjectGrain); }
96 inline size_t roundLargeObjectAllocation(size_t n) { return RXROUNDUP(n, LargeAllocationUnit); }
97 inline size_t roundObjectResize(size_t n) { return RXROUNDUP(n, ObjectGrain); }
98 
100 class MemorySegment;
101 class MemorySegmentPool;
102 class RexxMethod;
103 class RexxVariable;
104 class WeakReference;
105 class RexxIdentityTable;
107 
108 #ifdef _DEBUG
109 class RexxMemory;
110 #endif
111 
112 
113 enum
114 {
120 };
121  /* This class is implemented in */
122  /*OS2MEM.C, since the function is */
123  /*system dependant. */
124 typedef char MEMORY_POOL_STATE;
125 
127 #ifdef _DEBUG
128  friend class RexxMemory;
129 #endif
130 
131  protected:
134  char *nextAlloc;
136  size_t uncommitted;
137  size_t reserved; // force aligment of the state data....
138 };
139 
141 {
142 #ifdef _DEBUG
143  friend class RexxMemory;
144 #endif
145  friend bool SysAccessPool(MemorySegmentPool **);
146  public:
147  void *operator new(size_t size, size_t minSize);
148  void *operator new(size_t size, void *pool) { return pool;}
149  inline void operator delete(void *) { }
150  inline void operator delete(void *, size_t) { }
151  inline void operator delete(void *, void *) { }
152 
153  static MemorySegmentPool *createPool();
154 
156  MemorySegment *newSegment(size_t minSize);
157  MemorySegment *newLargeSegment(size_t minSize);
158  void freePool(void);
159  MemorySegmentPool *nextPool() {return this->next;}
160  void setNext( MemorySegmentPool *nextPool ); /* CHM - def.96: new function */
161 
162  private:
163  char state[8]; // must be at the end of the structure.
164 };
165 
166 #include "MemoryStats.hpp"
167 #include "MemorySegment.hpp"
168 
170 {
171 #ifdef _DEBUG
172  friend class RexxInstructionOptions;
173 #endif
174  public:
175  inline RexxMemory();
176  inline RexxMemory(RESTORETYPE restoreType) { ; };
177 
178  inline operator RexxObject*() { return (RexxObject *)this; };
179  inline RexxObject *operator=(DeadObject *d) { return (RexxObject *)this; };
180 
181  void live(size_t);
182  void liveGeneral(int reason);
183  void flatten(RexxEnvelope *);
185 
186  void initialize(bool restoringImage);
187  MemorySegment *newSegment(size_t requestLength, size_t minLength);
188  MemorySegment *newLargeSegment(size_t requestLength, size_t minLength);
189  RexxObject *oldObject(size_t size);
190  inline RexxObject *newObject(size_t size) { return newObject(size, T_Object); }
191  RexxObject *newObject(size_t size, size_t type);
192  RexxObject *temporaryObject(size_t size);
193  RexxArray *newObjects(size_t size, size_t count, size_t objectType);
194  void reSize(RexxObject *, size_t);
195  void checkUninit();
196  void runUninits();
197  void removeUninitObject(RexxObject *obj);
198  void addUninitObject(RexxObject *obj);
199  bool isPendingUninit(RexxObject *obj);
200  inline void checkUninitQueue() { if (pendingUninits > 0) runUninits(); }
201 
202  void markObjects(void);
203  void markObjectsMain(RexxObject *);
204  void killOrphans(RexxObject *);
205  void mark(RexxObject *);
206  void markGeneral(void *);
207  void collect();
208  inline RexxObject *saveObject(RexxInternalObject *saveObj) {this->saveTable->add((RexxObject *)saveObj, (RexxObject *)saveObj); return (RexxObject *)saveObj;}
209  inline void discardObject(RexxInternalObject *obj) {this->saveTable->remove((RexxObject *)obj);};
210  inline void removeHold(RexxInternalObject *obj) { this->saveStack->remove((RexxObject *)obj); }
213  void saveImage();
214  bool savingImage() { return saveimage; }
215  bool restoringImage() { return restoreimage; }
217  inline bool queryDump() {return this->dumpEnable;};
218  RexxObject *dump();
219  void dumpObject(RexxObject *objectRef, FILE *outfile);
220  void setObjectOffset(size_t offset);
221  void setEnvelope(RexxEnvelope *);
222  inline void setMarkTable(RexxTable *marktable) {this->markTable = marktable;};
223  inline void setOrphanCheck(bool orphancheck) {this->orphanCheck = orphancheck; };
224  RexxObject *checkSetOref(RexxObject *, RexxObject **, RexxObject *, const char *, int);
225  RexxObject *setOref(void *index, RexxObject *value);
227  void returnFlattenStack();
228  RexxObject *reclaim();
230  RexxObject *gutCheck();
232  void shutdown();
233  void liveStackFull();
234  void dumpMemoryProfile();
235  char * allocateImageBuffer(size_t size);
236  void logVerboseOutput(const char *message, void *sub1, void *sub2);
237  inline void verboseMessage(const char *message) {
238 #ifdef VERBOSE_GC
239  logVerboseOutput(message, NULL, NULL);
240 #endif
241  }
242 
243  inline void verboseMessage(const char *message, size_t sub1) {
244 #ifdef VERBOSE_GC
245  logVerboseOutput(message, (void *)sub1, NULL);
246 #endif
247  }
248 
249  inline void verboseMessage(const char *message, size_t sub1, size_t sub2) {
250 #ifdef VERBOSE_GC
251  logVerboseOutput(message, (void *)sub1, (void *)sub2);
252 #endif
253  }
254 
255  inline void logObjectStats(RexxObject *obj) { imageStats->logObject(obj); }
256  inline void pushSaveStack(RexxObject *obj) { saveStack->push(obj); }
257  inline void removeSavedObject(RexxObject *obj) { saveStack->remove(obj); }
258  inline void disableOrefChecks() { checkSetOK = false; }
259  inline void enableOrefChecks() { checkSetOK = true; }
260  inline void clearSaveStack() {
261  /* remove all objects from the save- */
262  /* stack. to be really oo, this */
263  /* should be done in RexxSaveStack, */
264  /* but we do it here for speed... */
265  memset(saveStack->stack, 0, sizeof(RexxObject*) * saveStack->size);
266  }
267 
268  void checkAllocs();
270  static void createLocks();
271  static void closeLocks();
272  void scavengeSegmentSets(MemorySegmentSet *requester, size_t allocationLength);
273  void setUpMemoryTables(RexxIdentityTable *old2newTable);
274  void collectAndUninit(bool clearStack);
275  void lastChanceUninit();
277  void addWeakReference(WeakReference *ref);
278  void checkWeakReferences();
279 
280  static void restore();
281  static void buildVirtualFunctionTable();
282  static void create();
283  static void createImage();
284  static RexxString *getGlobalName(const char *value);
285  static void createStrings();
286  static RexxArray *saveStrings();
287  static void restoreStrings(RexxArray *stringArray);
288 
289  static void *virtualFunctionTable[]; /* table of virtual functions */
290  static PCPPM exportedMethods[]; /* start of exported methods table */
291 
292  size_t markWord; /* current marking counter */
293  int markReason; // reason for calling liveGeneral()
294  RexxVariable *variableCache; /* our cache of variable objects */
295  GlobalProtectedObject *protectedObjects; // specially protected objects
296 
297  static RexxDirectory *environment; // global environment
298  static RexxDirectory *functionsDir; // statically defined requires
299  static RexxDirectory *commonRetrievers; // statically defined requires
300  static RexxDirectory *kernel; // the kernel directory
301  static RexxDirectory *system; // the system directory
302 
303 private:
304 
305 /******************************************************************************/
306 /* Define location of objects saved in SaveArray during Saveimage processing */
307 /* and used during restart processing. */
308 /* Currently only used in OKMEMORY.C */
309 /******************************************************************************/
310 enum
311 {
328 };
329 
330 
331  inline void checkLiveStack() { if (!liveStack->checkRoom()) liveStackFull(); }
332  inline void pushLiveStack(RexxObject *obj) { checkLiveStack(); liveStack->fastPush(obj); }
333  inline RexxObject * popLiveStack() { return (RexxObject *)liveStack->fastPop(); }
334  inline void bumpMarkWord() { markWord ^= MarkMask; }
335  inline void restoreMark(RexxObject *markObject, RexxObject **pMarkObject) {
336  /* we update the object's location */
337  *pMarkObject = (RexxObject *)((size_t)markObject + relocation);
338  }
339 
340  inline void unflattenMark(RexxObject *markObject, RexxObject **pMarkObject) {
341  /* do the unflatten */
342  *pMarkObject = markObject->unflatten(this->envelope);
343  }
344 
345  inline void restoreObjectMark(RexxObject *markObject, RexxObject **pMarkObject) {
346  /* update the object reference */
347  markObject = (RexxObject *)((char *)markObject + objOffset);
348  markObject->setObjectLive(markWord); /* Then Mark this object as live. */
349  *pMarkObject = markObject; /* now set this back again */
350  }
351 
352 
353 /* object validation method --used to find and diagnose broken object references */
354  void saveImageMark(RexxObject *markObject, RexxObject **pMarkObject);
355  void orphanCheckMark(RexxObject *markObject, RexxObject **pMarkObject);
356 
357  bool inObjectStorage(RexxObject *obj);
359  bool objectReferenceOK(RexxObject *o);
360  void restoreImage();
361 
362  static void defineKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments);
363  static void defineProtectedKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments);
364  static void definePrivateKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments);
365 
370  RexxTable *markTable; /* tabobjects to start a memory mark */
371  /* if building/restoring image, */
372  /*OREF_ENV, else old2new */
373  RexxIdentityTable *old2new; /* remd set */
374  RexxIdentityTable *uninitTable; // the table of objects with uninit methods
375  size_t pendingUninits; // objects waiting to have uninits run
376  bool processingUninits; // true when we are processing the uninit table
377 
378  MemorySegmentPool *firstPool; /* First segmentPool block. */
379  MemorySegmentPool *currentPool; /* Curent segmentPool being carved */
383  char *image_buffer; /* the buffer used for image save/restore operations */
384  size_t image_offset; /* the offset information for the image */
385  size_t relocation; /* image save/restore relocation factor */
386  bool dumpEnable; /* enabled for dumps? */
387  bool saveimage; /* we're saving the image */
388  bool restoreimage; /* we're restoring the image */
389  bool checkSetOK; /* OREF checking is enabled */
390  /* enabled for checking for bad */
391  /*OREF's? */
393  size_t objOffset; /* offset of arriving mobile objects */
394  /* envelope for arriving mobile */
395  /*objects */
397  RexxStack *originalLiveStack; /* original live stack allocation */
398  MemoryStats *imageStats; /* current statistics collector */
399 
400  size_t allocations; /* number of allocations since last GC */
401  size_t collections; /* number of garbage collections */
402  WeakReference *weakReferenceList; // list of active weak references
403 
404  static RexxDirectory *globalStrings; // table of global strings
405  static SysMutex flattenMutex; /* locks for various memory processes */
408 };
409 
410 
411 /******************************************************************************/
412 /* Memory management macros */
413 /******************************************************************************/
414 
415 
420 
421 
422 inline RexxObject *new_object(size_t s) { return memoryObject.newObject(s); }
423 inline RexxObject *new_object(size_t s, size_t t) { return memoryObject.newObject(s, t); }
424 
425 inline RexxArray *new_arrayOfObject(size_t s, size_t c, size_t t) { return memoryObject.newObjects(s, c, t); }
426 
427 #define setUpFlatten(type) \
428  { \
429  size_t newSelf = envelope->currentOffset; \
430  type * volatile newThis = (type *)this; // NB: This is declared volatile to avoid optimizer problems.
431 
432 #define cleanUpFlatten \
433  }
434 
435 #define ObjectNeedsMarking(oref) ((oref) != OREF_NULL && !((oref)->isObjectMarked(liveMark)) )
436 #define memory_mark(oref) if (ObjectNeedsMarking(oref)) memoryObject.mark((RexxObject *)(oref))
437 #define memory_mark_general(oref) (memoryObject.markGeneral((void *)&(oref)))
438 
439 /* Following macros are for Flattening and unflattening of objects */
440 #define flatten_reference(oref,envel) if (oref) envel->flattenReference((void *)&newThis, newSelf, (void *)&(oref))
441 
442 // declare a class creation routine
443 // for classes with their own
444 // explicit class objects
445 #define CLASS_CREATE(name, id, className) The##name##Class = (className *)new (sizeof(className), id, The##name##ClassBehaviour, The##name##Behaviour) RexxClass;
446 
447 #endif
RexxMemory::variableCache
RexxVariable * variableCache
Definition: RexxMemory.hpp:294
RexxMemory::globalStrings
static RexxDirectory * globalStrings
Definition: RexxMemory.hpp:404
RexxMemory::restoringImage
bool restoringImage()
Definition: RexxMemory.hpp:215
SetObjectLive
void SetObjectLive(void *o, size_t mark)
Definition: RexxMemory.hpp:89
RexxMemory::dumpObject
void dumpObject(RexxObject *objectRef, FILE *outfile)
Definition: RexxMemory.cpp:251
RexxMemory::inSharedObjectStorage
bool inSharedObjectStorage(RexxObject *obj)
Definition: RexxMemory.cpp:269
RexxMemory::setOrphanCheck
void setOrphanCheck(bool orphancheck)
Definition: RexxMemory.hpp:223
DeadObject
Definition: DeadObject.hpp:59
RexxMemory::checkWeakReferences
void checkWeakReferences()
Definition: RexxMemory.cpp:666
RexxActivationFrameBuffer
Definition: RexxActivationStack.hpp:49
RexxMemory::logObjectStats
void logObjectStats(RexxObject *obj)
Definition: RexxMemory.hpp:255
RexxSaveStack::remove
void remove(RexxObject *, bool search=false)
Definition: StackClass.cpp:226
RexxArray
Definition: ArrayClass.hpp:100
RexxMemory::clearSaveStack
void clearSaveStack()
Definition: RexxMemory.hpp:260
MarkMask
Definition: ObjectClass.hpp:73
RexxMemory::saveArray_COMMON_RETRIEVERS
Definition: RexxMemory.hpp:326
RexxMemory::saveArray_FALSE
Definition: RexxMemory.hpp:316
RexxMemory::checkUninitQueue
void checkUninitQueue()
Definition: RexxMemory.hpp:200
RexxMemory
Definition: RexxMemory.hpp:169
RexxMemory::markGeneral
void markGeneral(void *)
Definition: RexxMemory.cpp:1414
RexxInternalObject
Definition: ObjectClass.hpp:206
RexxMemory::protectedObjects
GlobalProtectedObject * protectedObjects
Definition: RexxMemory.hpp:295
RexxMemory::newObject
RexxObject * newObject(size_t size)
Definition: RexxMemory.hpp:190
RexxStack::size
size_t size
Definition: StackClass.hpp:80
RexxMemory::memoryPoolAdded
void memoryPoolAdded(MemorySegmentPool *)
Definition: RexxMemory.cpp:2182
MEMORY_POOL_STATE
char MEMORY_POOL_STATE
Definition: RexxMemory.hpp:124
RexxMemory::collections
size_t collections
Definition: RexxMemory.hpp:401
RexxMemory::verboseMessage
void verboseMessage(const char *message)
Definition: RexxMemory.hpp:237
RexxMemory::logVerboseOutput
void logVerboseOutput(const char *message, void *sub1, void *sub2)
Definition: RexxMemory.cpp:231
memoryObject
RexxMemory memoryObject
Definition: RexxMemory.cpp:84
RexxInternalObject::behaviour
RexxBehaviour * behaviour
Definition: ObjectClass.hpp:306
RexxMemory::saveArray_NAME_STRINGS
Definition: RexxMemory.hpp:314
type
int type
Definition: cmdparse.cpp:1965
RexxMemory::allocations
size_t allocations
Definition: RexxMemory.hpp:400
T_Object
Definition: ClassTypeCodes.h:57
RexxMemory::processingUninits
bool processingUninits
Definition: RexxMemory.hpp:376
RexxMemory::checkAllocs
void checkAllocs()
RexxMemory::RexxMemory
RexxMemory()
Definition: RexxMemory.cpp:117
RexxMemory::collectAndUninit
void collectAndUninit(bool clearStack)
Definition: RexxMemory.cpp:479
RexxMemory::newSpaceLargeSegments
LargeSegmentSet newSpaceLargeSegments
Definition: RexxMemory.hpp:382
RexxMemory::temporaryObject
RexxObject * temporaryObject(size_t size)
Definition: RexxMemory.cpp:1390
RexxMemory::system
static RexxDirectory * system
Definition: RexxMemory.hpp:301
RexxMemory::savingImage
bool savingImage()
Definition: RexxMemory.hpp:214
LargeSegmentSet
Definition: MemorySegment.hpp:546
LargeAllocationUnit
#define LargeAllocationUnit
Definition: RexxMemory.hpp:76
MemorySegment.hpp
RexxMemory::dumpImageStats
RexxObject * dumpImageStats()
Definition: RexxMemory.cpp:2157
RexxMemory::createLocks
static void createLocks()
Definition: RexxMemory.cpp:2243
RexxMemory::initialize
void initialize(bool restoringImage)
Definition: RexxMemory.cpp:160
ObjectGrain
#define ObjectGrain
Definition: RexxMemory.hpp:74
RexxMemory::saveArray_CLASS
Definition: RexxMemory.hpp:319
RexxMemory::addUninitObject
void addUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:589
IdentityTableClass.hpp
RexxMemory::markWord
size_t markWord
Definition: RexxMemory.hpp:292
RexxMemory::bumpMarkWord
void bumpMarkWord()
Definition: RexxMemory.hpp:334
RexxMemory::newSegment
MemorySegment * newSegment(size_t requestLength, size_t minLength)
Definition: RexxMemory.cpp:713
RexxMemory::disableOrefChecks
void disableOrefChecks()
Definition: RexxMemory.hpp:258
RexxMemory::saveArray_ENV
Definition: RexxMemory.hpp:312
RexxMemory::currentPool
MemorySegmentPool * currentPool
Definition: RexxMemory.hpp:379
MemorySegmentPool::state
char state[8]
Definition: RexxMemory.hpp:163
RexxMemory::createStrings
static void createStrings()
Definition: GlobalNames.cpp:47
RexxMemory::RexxMemory
RexxMemory(RESTORETYPE restoreType)
Definition: RexxMemory.hpp:176
RexxMemory::virtualFunctionTable
static void * virtualFunctionTable[]
Definition: RexxMemory.hpp:289
LIVEMARK
Definition: RexxMemory.hpp:115
RexxStack::stack
RexxObject * stack[1]
Definition: StackClass.hpp:82
MemorySegmentPool
Definition: RexxMemory.hpp:140
RexxMemory::envelope
RexxEnvelope * envelope
Definition: RexxMemory.hpp:396
RexxMemory::newObjects
RexxArray * newObjects(size_t size, size_t count, size_t objectType)
Definition: RexxMemory.cpp:1133
roundObjectBoundary
size_t roundObjectBoundary(size_t n)
Definition: RexxMemory.hpp:95
SysSemaphore.hpp
RexxMemory::objectReferenceOK
bool objectReferenceOK(RexxObject *o)
Definition: RexxMemory.cpp:318
RexxMemory::saveArray_NULLPOINTER
Definition: RexxMemory.hpp:323
NormalSegmentSet
Definition: MemorySegment.hpp:386
RexxMemory::removeSavedObject
void removeSavedObject(RexxObject *obj)
Definition: RexxMemory.hpp:257
RexxMemory::saveObject
RexxObject * saveObject(RexxInternalObject *saveObj)
Definition: RexxMemory.hpp:208
RexxMemory::pushSaveStack
void pushSaveStack(RexxObject *obj)
Definition: RexxMemory.hpp:256
RexxEnvelope
Definition: RexxEnvelope.hpp:53
MemorySegmentPool::createPool
static MemorySegmentPool * createPool()
Definition: MemorySupport.cpp:82
UNFLATTENINGOBJECT
Definition: RexxMemory.hpp:119
RexxMemory::dumpMemoryProfile
void dumpMemoryProfile()
Definition: RexxMemory.cpp:239
RexxMemory::restore
static void restore()
Definition: RexxMemory.cpp:2317
RXROUNDUP
#define RXROUNDUP(n, to)
Definition: RexxCore.h:208
RexxMemory::markObjects
void markObjects(void)
Definition: RexxMemory.cpp:615
RexxBehaviour
Definition: RexxBehaviour.hpp:49
discardObject
void discardObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:417
OldSpaceSegmentSet
Definition: MemorySegment.hpp:597
MemorySegmentPool::freePool
void freePool(void)
Definition: MemorySupport.cpp:278
RexxMemory::orphanCheck
bool orphanCheck
Definition: RexxMemory.hpp:392
RexxMemory::checkLiveStack
void checkLiveStack()
Definition: RexxMemory.hpp:331
RexxMemory::checkSetOK
bool checkSetOK
Definition: RexxMemory.hpp:389
RexxMemory::allocateImageBuffer
char * allocateImageBuffer(size_t size)
Definition: RexxMemory.cpp:1060
RexxMemory::buildVirtualFunctionTable
static void buildVirtualFunctionTable()
Definition: VirtualFunctionTable.cpp:169
RexxMemory::queryDump
bool queryDump()
Definition: RexxMemory.hpp:217
RexxInstructionOptions
Definition: OptionsInstruction.hpp:49
RexxMemory::unflattenMutex
static SysMutex unflattenMutex
Definition: RexxMemory.hpp:406
RexxMemory::holdObject
RexxObject * holdObject(RexxInternalObject *obj)
Definition: RexxMemory.cpp:1638
RexxMemory::defineKernelMethod
static void defineKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments)
Definition: Setup.cpp:91
RexxMemory::restoreImage
void restoreImage()
Definition: RexxMemory.cpp:790
RexxMemory::pendingUninits
size_t pendingUninits
Definition: RexxMemory.hpp:375
RexxMemory::unflattenMark
void unflattenMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:340
MemorySegment
Definition: MemorySegment.hpp:143
MemorySegmentPoolHeader::reserved
size_t reserved
Definition: RexxMemory.hpp:137
RexxMemory::saveStrings
static RexxArray * saveStrings()
Definition: GlobalNames.cpp:64
holdObject
void holdObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:418
RexxMemory::environment
static RexxDirectory * environment
Definition: RexxMemory.hpp:297
RexxMemory::removeHold
void removeHold(RexxInternalObject *obj)
Definition: RexxMemory.hpp:210
RexxMemory::shutdown
void shutdown()
Definition: RexxMemory.cpp:2188
RexxMemory::checkUninit
void checkUninit()
Definition: RexxMemory.cpp:441
RexxMemory::saveArray_FUNCTIONS
Definition: RexxMemory.hpp:325
RexxMemory::enableOrefChecks
void enableOrefChecks()
Definition: RexxMemory.hpp:259
RexxDirectory
Definition: DirectoryClass.hpp:49
MemorySegmentPoolHeader::nextLargeAlloc
char * nextLargeAlloc
Definition: RexxMemory.hpp:135
RexxMemory::operator=
RexxObject * operator=(DeadObject *d)
Definition: RexxMemory.hpp:179
RexxSaveStack
Definition: StackClass.hpp:85
RexxMemory::saveArray_KERNEL
Definition: RexxMemory.hpp:313
RexxMemory::saveArray_highest
Definition: RexxMemory.hpp:327
RexxStack
Definition: StackClass.hpp:47
RexxMemory::functionsDir
static RexxDirectory * functionsDir
Definition: RexxMemory.hpp:298
RexxMemory::saveArray_NIL
Definition: RexxMemory.hpp:317
RexxMemory::uninitTable
RexxIdentityTable * uninitTable
Definition: RexxMemory.hpp:374
RexxMemory::closeLocks
static void closeLocks()
Definition: RexxMemory.cpp:2256
discardHoldObject
void discardHoldObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:419
RexxMemory::restoreObjectMark
void restoreObjectMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:345
RexxVirtualBase::unflatten
virtual RexxObject * unflatten(RexxEnvelope *)
Definition: ObjectClass.hpp:177
RexxMemory::weakReferenceList
WeakReference * weakReferenceList
Definition: RexxMemory.hpp:402
RexxMemory::verboseMessage
void verboseMessage(const char *message, size_t sub1, size_t sub2)
Definition: RexxMemory.hpp:249
RexxMemory::restoreStrings
static void restoreStrings(RexxArray *stringArray)
Definition: GlobalNames.cpp:92
RexxMemory::setParms
RexxObject * setParms(RexxObject *, RexxObject *)
Definition: RexxMemory.cpp:1649
RexxMemory::saveArray_SYSTEM
Definition: RexxMemory.hpp:324
RexxMemory::setMarkTable
void setMarkTable(RexxTable *marktable)
Definition: RexxMemory.hpp:222
RexxMemory::liveGeneral
void liveGeneral(int reason)
Definition: RexxMemory.cpp:936
RexxMemory::runUninits
void runUninits()
Definition: RexxMemory.cpp:507
SysMutex
Definition: SysSemaphore.hpp:73
MemoryStats
Definition: MemoryStats.hpp:97
RexxStack::fastPop
RexxObject * fastPop()
Definition: StackClass.hpp:72
RexxMemory::originalLiveStack
RexxStack * originalLiveStack
Definition: RexxMemory.hpp:397
RexxMemory::getGlobalStrings
RexxDirectory * getGlobalStrings()
Definition: RexxMemory.hpp:276
PCPPM
RexxObject *(RexxObject::* PCPPM)()
Definition: ObjectClass.hpp:198
RexxMemory::saveStack
RexxSaveStack * saveStack
Definition: RexxMemory.hpp:368
RexxMemory::newLargeSegment
MemorySegment * newLargeSegment(size_t requestLength, size_t minLength)
Definition: RexxMemory.cpp:753
RexxMemory::discardHoldObject
void discardHoldObject(RexxInternalObject *obj)
Definition: RexxMemory.cpp:1629
RexxMemory::createImage
static void createImage()
Definition: Setup.cpp:132
MemorySegmentPool::newLargeSegment
MemorySegment * newLargeSegment(size_t minSize)
Definition: MemorySupport.cpp:229
RexxMemory::killOrphans
void killOrphans(RexxObject *)
Definition: RexxMemory.cpp:376
MemorySegmentPool::setNext
void setNext(MemorySegmentPool *nextPool)
Definition: MemorySupport.cpp:287
RexxMemory::setUpMemoryTables
void setUpMemoryTables(RexxIdentityTable *old2newTable)
Definition: RexxMemory.cpp:2210
RexxMemory::popLiveStack
RexxObject * popLiveStack()
Definition: RexxMemory.hpp:333
RexxIdentityTable::remove
virtual RexxObject * remove(RexxObject *key)
Definition: IdentityTableClass.cpp:95
RexxMemory::oldSpaceSegments
OldSpaceSegmentSet oldSpaceSegments
Definition: RexxMemory.hpp:380
MemoryStats.hpp
RexxMemory::old2new
RexxIdentityTable * old2new
Definition: RexxMemory.hpp:373
MemorySegmentPoolHeader
Definition: RexxMemory.hpp:126
SAVINGIMAGE
Definition: RexxMemory.hpp:117
RexxStack::checkRoom
bool checkRoom()
Definition: StackClass.hpp:71
FLATTENINGOBJECT
Definition: RexxMemory.hpp:118
RexxMemory::saveImageMark
void saveImageMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.cpp:1475
RexxMemory::saveArray_PACKAGES
Definition: RexxMemory.hpp:321
RexxMemory::firstPool
MemorySegmentPool * firstPool
Definition: RexxMemory.hpp:378
RexxMemory::saveArray_GLOBAL_STRINGS
Definition: RexxMemory.hpp:318
RexxStack::push
RexxObject * push(RexxObject *obj)
Definition: StackClass.hpp:63
RexxMemory::dumpEnable
bool dumpEnable
Definition: RexxMemory.hpp:386
new_arrayOfObject
RexxArray * new_arrayOfObject(size_t s, size_t c, size_t t)
Definition: RexxMemory.hpp:425
RexxMemory::mark
void mark(RexxObject *)
Definition: RexxMemory.cpp:1356
MemorySegmentPool::nextPool
MemorySegmentPool * nextPool()
Definition: RexxMemory.hpp:159
RexxMemory::liveStackFull
void liveStackFull()
Definition: RexxMemory.cpp:1339
RexxTable
Definition: TableClass.hpp:49
GlobalProtectedObject
Definition: GlobalProtectedObject.hpp:46
MemorySegmentPool::newSegment
MemorySegment * newSegment(size_t minSize)
Definition: MemorySupport.cpp:184
RexxMemory::setOref
RexxObject * setOref(void *index, RexxObject *value)
Definition: RexxMemory.cpp:1996
MemorySegmentPoolHeader::nextAlloc
char * nextAlloc
Definition: RexxMemory.hpp:134
RexxMemory::kernel
static RexxDirectory * kernel
Definition: RexxMemory.hpp:300
RexxIdentityTable::add
virtual RexxObject * add(RexxObject *, RexxObject *)
Definition: IdentityTableClass.cpp:161
RexxMemory::setEnvelope
void setEnvelope(RexxEnvelope *)
Definition: RexxMemory.cpp:1962
RexxMemory::saveArray_PBEHAV
Definition: RexxMemory.hpp:320
RexxInternalObject::setObjectLive
void setObjectLive(size_t markword)
Definition: ObjectClass.hpp:238
RexxMemory::orphanCheckMark
void orphanCheckMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.cpp:1543
RexxMemory::getGlobalName
static RexxString * getGlobalName(const char *value)
Definition: RexxMemory.cpp:2277
MemorySegmentPoolHeader::uncommitted
size_t uncommitted
Definition: RexxMemory.hpp:136
RexxMemory::markObjectsMain
void markObjectsMain(RexxObject *)
Definition: RexxMemory.cpp:341
roundObjectResize
size_t roundObjectResize(size_t n)
Definition: RexxMemory.hpp:97
RexxMemory::saveImage
void saveImage()
Definition: RexxMemory.cpp:1657
RexxMemory::imageStats
MemoryStats * imageStats
Definition: RexxMemory.hpp:398
RexxMemory::dump
RexxObject * dump()
Definition: RexxMemory.cpp:1771
RexxMemory::setObjectOffset
void setObjectOffset(size_t offset)
Definition: RexxMemory.cpp:1927
MemorySegmentPoolHeader::spareSegment
MemorySegment * spareSegment
Definition: RexxMemory.hpp:133
RexxMemory::lastChanceUninit
void lastChanceUninit()
Definition: RexxMemory.cpp:497
RexxMemory::envelopeMutex
static SysMutex envelopeMutex
Definition: RexxMemory.hpp:407
RexxMemory::live
void live(size_t)
Definition: RexxMemory.cpp:902
RESTORINGIMAGE
Definition: RexxMemory.hpp:116
MemorySegmentPoolHeader::next
MemorySegmentPool * next
Definition: RexxMemory.hpp:132
RexxMemory::commonRetrievers
static RexxDirectory * commonRetrievers
Definition: RexxMemory.hpp:299
RexxMemory::oldObject
RexxObject * oldObject(size_t size)
Definition: RexxMemory.cpp:1034
RexxMemory::defineProtectedKernelMethod
static void defineProtectedKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments)
Definition: Setup.cpp:103
RexxMemory::markTable
RexxTable * markTable
Definition: RexxMemory.hpp:370
RexxMemory::saveTable
RexxIdentityTable * saveTable
Definition: RexxMemory.hpp:369
RexxMemory::relocation
size_t relocation
Definition: RexxMemory.hpp:385
saveObject
void saveObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:416
RexxMemory::restoreMark
void restoreMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:335
RexxMemory::isPendingUninit
bool isPendingUninit(RexxObject *obj)
Definition: RexxMemory.cpp:606
RexxIdentityTable
Definition: IdentityTableClass.hpp:49
RexxMemory::exportedMethods
static PCPPM exportedMethods[]
Definition: RexxMemory.hpp:290
RexxMemory::checkSetOref
RexxObject * checkSetOref(RexxObject *, RexxObject **, RexxObject *, const char *, int)
Definition: RexxMemory.cpp:2066
RexxMemory::reclaim
RexxObject * reclaim()
Definition: RexxMemory.cpp:989
MemorySegmentPool::SysAccessPool
friend bool SysAccessPool(MemorySegmentPool **)
roundLargeObjectAllocation
size_t roundLargeObjectAllocation(size_t n)
Definition: RexxMemory.hpp:96
RexxMemory::saveimage
bool saveimage
Definition: RexxMemory.hpp:387
RexxMemory::restoreimage
bool restoreimage
Definition: RexxMemory.hpp:388
MemoryStats::logObject
void logObject(RexxObject *obj)
Definition: MemoryStats.cpp:164
RexxMemory::inObjectStorage
bool inObjectStorage(RexxObject *obj)
Definition: RexxMemory.cpp:299
RexxMemory::scavengeSegmentSets
void scavengeSegmentSets(MemorySegmentSet *requester, size_t allocationLength)
Definition: RexxMemory.cpp:1293
RexxMemory::objOffset
size_t objOffset
Definition: RexxMemory.hpp:393
RexxMemory::getFlattenStack
RexxStack * getFlattenStack()
Definition: RexxMemory.cpp:2129
MemorySegmentPool::MemorySegmentPool
MemorySegmentPool()
Definition: MemorySupport.cpp:174
RexxMemory::saveArray_NULLA
Definition: RexxMemory.hpp:322
RexxMemory::newSpaceNormalSegments
NormalSegmentSet newSpaceNormalSegments
Definition: RexxMemory.hpp:381
RexxMemory::verboseMessage
void verboseMessage(const char *message, size_t sub1)
Definition: RexxMemory.hpp:243
RexxMemory::markReason
int markReason
Definition: RexxMemory.hpp:293
RESTORETYPE
RESTORETYPE
Definition: ObjectClass.hpp:80
RexxMemory::gutCheck
RexxObject * gutCheck()
Definition: RexxMemory.cpp:1843
RexxMemory::image_offset
size_t image_offset
Definition: RexxMemory.hpp:384
RexxMethod
Definition: MethodClass.hpp:101
RexxMemory::image_buffer
char * image_buffer
Definition: RexxMemory.hpp:383
RexxMemory::discardObject
void discardObject(RexxInternalObject *obj)
Definition: RexxMemory.hpp:209
new_object
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:422
MemorySegmentSet
Definition: MemorySegment.hpp:227
RexxMemory::makeProxy
RexxObject * makeProxy(RexxEnvelope *)
Definition: RexxMemory.cpp:968
RexxMemory::flatten
void flatten(RexxEnvelope *)
Definition: RexxMemory.cpp:958
RexxMemory::create
static void create()
Definition: RexxMemory.cpp:2300
RexxMemory::pushLiveStack
void pushLiveStack(RexxObject *obj)
Definition: RexxMemory.hpp:332
RexxMemory::collect
void collect()
Definition: RexxMemory.cpp:1001
RexxStack::fastPush
void fastPush(RexxObject *element)
Definition: StackClass.hpp:70
RexxMemory::setDump
RexxObject * setDump(RexxObject *)
Definition: RexxMemory.cpp:1829
RexxMemory::saveArray_TRUE
Definition: RexxMemory.hpp:315
WeakReference
Definition: WeakReferenceClass.hpp:54
RexxMemory::definePrivateKernelMethod
static void definePrivateKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments)
Definition: Setup.cpp:117
RexxMemory::reSize
void reSize(RexxObject *, size_t)
Definition: RexxMemory.cpp:1249
RexxObject
Definition: ObjectClass.hpp:311
RexxMemory::flattenStack
RexxStack * flattenStack
Definition: RexxMemory.hpp:367
RexxMemory::flattenMutex
static SysMutex flattenMutex
Definition: RexxMemory.hpp:405
RexxMemory::addWeakReference
void addWeakReference(WeakReference *ref)
Definition: RexxMemory.cpp:702
RexxString
Definition: StringClass.hpp:119
RexxVariable
Definition: RexxVariable.hpp:49
RexxMemory::removeUninitObject
void removeUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:578
RexxMemory::liveStack
RexxStack * liveStack
Definition: RexxMemory.hpp:366
RexxMemory::returnFlattenStack
void returnFlattenStack()
Definition: RexxMemory.cpp:2148