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
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, const char *imageTarget);
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) verboseMessage("Calling runUninits from checkUninitQueue (pendingUninits=%d%s)\n",
202  size_t(processingUninits ? " recursive" : ""));
203  if (pendingUninits > 0) runUninits(); }
204 
205  void markObjects(void);
206  void markObjectsMain(RexxObject *);
207  void killOrphans(RexxObject *);
208  void mark(RexxObject *);
209  void markGeneral(void *);
210  void collect();
211  inline RexxObject *saveObject(RexxInternalObject *saveObj) {this->saveTable->add((RexxObject *)saveObj, (RexxObject *)saveObj); return (RexxObject *)saveObj;}
212  inline void discardObject(RexxInternalObject *obj) {this->saveTable->remove((RexxObject *)obj);};
213  inline void removeHold(RexxInternalObject *obj) { this->saveStack->remove((RexxObject *)obj); }
216  void saveImage(const char *imageTarget);
217  bool savingImage() { return saveimage; }
218  bool restoringImage() { return restoreimage; }
220  inline bool queryDump() {return this->dumpEnable;};
221  RexxObject *dump();
222  void dumpObject(RexxObject *objectRef, FILE *outfile);
223  void setObjectOffset(size_t offset);
224  void setEnvelope(RexxEnvelope *);
225  inline void setMarkTable(RexxTable *marktable) {this->markTable = marktable;};
226  inline void setOrphanCheck(bool orphancheck) {this->orphanCheck = orphancheck; };
227  RexxObject *checkSetOref(RexxObject *, RexxObject **, RexxObject *, const char *, int);
228  RexxObject *setOref(void *index, RexxObject *value);
230  void returnFlattenStack();
231  RexxObject *reclaim();
233  RexxObject *gutCheck();
235  void shutdown();
236  void liveStackFull();
237  void dumpMemoryProfile();
238  char * allocateImageBuffer(size_t size);
239  void logVerboseOutput(const char *message, void *sub1, void *sub2);
240  inline void verboseMessage(const char *message) {
241 #ifdef VERBOSE_GC
242  logVerboseOutput(message, NULL, NULL);
243 #endif
244  }
245 
246  inline void verboseMessage(const char *message, size_t sub1) {
247 #ifdef VERBOSE_GC
248  logVerboseOutput(message, (void *)sub1, NULL);
249 #endif
250  }
251 
252  inline void verboseMessage(const char *message, size_t sub1, size_t sub2) {
253 #ifdef VERBOSE_GC
254  logVerboseOutput(message, (void *)sub1, (void *)sub2);
255 #endif
256  }
257 
258  inline void verboseMessage(const char *message, const char *sub1, size_t sub2) {
259 #ifdef VERBOSE_GC
260  logVerboseOutput(message, (void *)sub1, (void *)sub2);
261 #endif
262  }
263 
264  inline void logObjectStats(RexxObject *obj) { imageStats->logObject(obj); }
265  inline void pushSaveStack(RexxObject *obj) { saveStack->push(obj); }
266  inline void removeSavedObject(RexxObject *obj) { saveStack->remove(obj); }
267  inline void disableOrefChecks() { checkSetOK = false; }
268  inline void enableOrefChecks() { checkSetOK = true; }
269  inline void clearSaveStack() {
270  /* remove all objects from the save- */
271  /* stack. to be really oo, this */
272  /* should be done in RexxSaveStack, */
273  /* but we do it here for speed... */
274  memset(saveStack->stack, 0, sizeof(RexxObject*) * saveStack->size);
275  }
276 
277  void checkAllocs();
279  static void createLocks();
280  static void closeLocks();
281  void scavengeSegmentSets(MemorySegmentSet *requester, size_t allocationLength);
282  void setUpMemoryTables(RexxIdentityTable *old2newTable);
283  void collectAndUninit(bool clearStack);
284  void lastChanceUninit();
286  void addWeakReference(WeakReference *ref);
287  void checkWeakReferences();
288 
289  static void restore();
290  static void buildVirtualFunctionTable();
291  static void create();
292  static void createImage(const char *imageTarget);
293  static RexxString *getGlobalName(const char *value);
294  static void createStrings();
295  static RexxArray *saveStrings();
296  static void restoreStrings(RexxArray *stringArray);
297  static void addToSystem(const char *name, RexxInternalObject *classObj); // ooRexx5
298  static void completeSystemClass(const char *name, RexxClass *classObj); // ooRexx5
299  static void createRexxPackage(); // ooRexx5
300 
301  static void *virtualFunctionTable[]; /* table of virtual functions */
302  static PCPPM exportedMethods[]; /* start of exported methods table */
303 
304  size_t markWord; /* current marking counter */
305  int markReason; // reason for calling liveGeneral()
306  RexxVariable *variableCache; /* our cache of variable objects */
307  GlobalProtectedObject *protectedObjects; // specially protected objects
308 
309  static RexxDirectory *environment; // global environment
310  static RexxDirectory *functionsDir; // statically defined requires
311  static RexxDirectory *commonRetrievers; // statically defined requires
312  static RexxDirectory *kernel; // the kernel directory
313  static RexxDirectory *system; // the system directory
314  static PackageClass *rexxPackage; // the main rexx package // ooRexx5
315 
316 private:
317 
318 /******************************************************************************/
319 /* Define location of objects saved in SaveArray during Saveimage processing */
320 /* and used during restart processing. */
321 /* Currently only used in OKMEMORY.C */
322 /******************************************************************************/
323 enum
324 {
342 };
343 
344 
345  inline void checkLiveStack() { if (!liveStack->checkRoom()) liveStackFull(); }
346  inline void pushLiveStack(RexxObject *obj) { checkLiveStack(); liveStack->fastPush(obj); }
347  inline RexxObject * popLiveStack() { return (RexxObject *)liveStack->fastPop(); }
348  inline void bumpMarkWord() { markWord ^= MarkMask; }
349  inline void restoreMark(RexxObject *markObject, RexxObject **pMarkObject) {
350  /* we update the object's location */
351  *pMarkObject = (RexxObject *)((size_t)markObject + relocation);
352  }
353 
354  inline void unflattenMark(RexxObject *markObject, RexxObject **pMarkObject) {
355  /* do the unflatten */
356  *pMarkObject = markObject->unflatten(this->envelope);
357  }
358 
359  inline void restoreObjectMark(RexxObject *markObject, RexxObject **pMarkObject) {
360  /* update the object reference */
361  markObject = (RexxObject *)((char *)markObject + objOffset);
362  markObject->setObjectLive(markWord); /* Then Mark this object as live. */
363  *pMarkObject = markObject; /* now set this back again */
364  }
365 
366 
367 /* object validation method --used to find and diagnose broken object references */
368  void saveImageMark(RexxObject *markObject, RexxObject **pMarkObject);
369  void orphanCheckMark(RexxObject *markObject, RexxObject **pMarkObject);
370 
371  bool inObjectStorage(RexxObject *obj);
373  bool objectReferenceOK(RexxObject *o);
374  void restoreImage();
375 
376  static void defineKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false);
377  static void defineProtectedKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false);
378  static void definePrivateKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false);
379 
384  RexxTable *markTable; /* tabobjects to start a memory mark */
385  /* if building/restoring image, */
386  /*OREF_ENV, else old2new */
387  RexxIdentityTable *old2new; /* remd set */
388  RexxIdentityTable *uninitTable; // the table of objects with uninit methods
389  size_t pendingUninits; // objects waiting to have uninits run
390  bool processingUninits; // true when we are processing the uninit table
391 
392  MemorySegmentPool *firstPool; /* First segmentPool block. */
393  MemorySegmentPool *currentPool; /* Curent segmentPool being carved */
397  char *image_buffer; /* the buffer used for image save/restore operations */
398  size_t image_offset; /* the offset information for the image */
399  size_t relocation; /* image save/restore relocation factor */
400  bool dumpEnable; /* enabled for dumps? */
401  bool saveimage; /* we're saving the image */
402  bool restoreimage; /* we're restoring the image */
403  bool checkSetOK; /* OREF checking is enabled */
404  /* enabled for checking for bad */
405  /*OREF's? */
407  size_t objOffset; /* offset of arriving mobile objects */
408  /* envelope for arriving mobile */
409  /*objects */
411  RexxStack *originalLiveStack; /* original live stack allocation */
412  MemoryStats *imageStats; /* current statistics collector */
413 
414  size_t allocations; /* number of allocations since last GC */
415  size_t collections; /* number of garbage collections */
416  WeakReference *weakReferenceList; // list of active weak references
417 
418  static RexxDirectory *globalStrings; // table of global strings
419  static SysMutex flattenMutex; /* locks for various memory processes */
422 };
423 
424 
425 /******************************************************************************/
426 /* Memory management macros */
427 /******************************************************************************/
428 
429 
434 
435 
436 inline RexxObject *new_object(size_t s) { return memoryObject.newObject(s); }
437 inline RexxObject *new_object(size_t s, size_t t) { return memoryObject.newObject(s, t); }
438 
439 inline RexxArray *new_arrayOfObject(size_t s, size_t c, size_t t) { return memoryObject.newObjects(s, c, t); }
440 
441 #define setUpFlatten(type) \
442  { \
443  size_t newSelf = envelope->currentOffset; \
444  type * volatile newThis = (type *)this; // NB: This is declared volatile to avoid optimizer problems.
445 
446 #define cleanUpFlatten \
447  }
448 
449 #define ObjectNeedsMarking(oref) ((oref) != OREF_NULL && !((oref)->isObjectMarked(liveMark)) )
450 #define memory_mark(oref) if (ObjectNeedsMarking(oref)) memoryObject.mark((RexxObject *)(oref))
451 #define memory_mark_general(oref) (memoryObject.markGeneral((void *)&(oref)))
452 
453 // some convenience macros for marking arrays of objects.
454 #define memory_mark_array(count, array) \
455  for (size_t i = 0; i < count; i++) \
456  { \
457  memory_mark(array[i]); \
458  }
459 
460 #define memory_mark_general_array(count, array) \
461  for (size_t i = 0; i < count; i++) \
462  { \
463  memory_mark_general(array[i]); \
464  }
465 
466 // Following macros are for Flattening and unflattening of objects
467 // Some notes on what is going on here. The flatten() method gets called on an object
468 // after it has been moved into the envelope buffer, so the this pointer is
469 // to the copied object, not the original. On a call to flattenReference(), it might
470 // be necessary to allocate a larger buffer. When that happens, the copied object gets
471 // moved to a new location and the newThis pointer gets updated to the new object location.
472 // it is necessary to copy the this pointer and also declare the newThis pointer as volatile
473 // so that the change in pointer value doesn't get optimized out by the compiler.
474 
475 // set up for flattening. This sets up the newThis pointer and also gets some
476 // information from the envelope. The type argument allows newThis to be declared with
477 // the correct type.
478 #define setUpFlatten(type) \
479  { \
480  size_t newSelf = envelope->currentOffset; \
481  type * volatile newThis = (type *)this; // NB: This is declared volatile to avoid optimizer problems.
482 
483 // just a block closer for the block created by setUpFlatten.
484 #define cleanUpFlatten \
485  }
486 
487 // newer, simplified form. Just give the name of the field.
488 #define flattenRef(oref) if ((newThis->oref) != OREF_NULL) envelope->flattenReference((void *)&newThis, newSelf, (void *)&(newThis->oref))
489 
490 // a version for flattening arrays of objects. Give the count field and the name of the array.
491 #define flattenArrayRefs(count, array) \
492  for (size_t i = 0; i < count; i++) \
493  { \
494  flattenRef(array[i]); \
495  }
496 
497 /* Following macros are for Flattening and unflattening of objects */
498 #define flatten_reference(oref,envel) if (oref) envel->flattenReference((void *)&newThis, newSelf, (void *)&(oref))
499 
500 // declare a class creation routine
501 // for classes with their own
502 // explicit class objects
503 #define CLASS_CREATE(name, id, className) The##name##Class = (className *)new (sizeof(className), id, The##name##ClassBehaviour, The##name##Behaviour) RexxClass;
504 
505 #endif
@ T_Object
RESTORETYPE
Definition: ObjectClass.hpp:82
RexxObject *(RexxObject::* PCPPM)()
@ MarkMask
Definition: ObjectClass.hpp:75
#define RXROUNDUP(n, to)
Definition: RexxCore.h:221
RexxMemory memoryObject
Definition: RexxMemory.cpp:86
RexxArray * new_arrayOfObject(size_t s, size_t c, size_t t)
Definition: RexxMemory.hpp:439
void saveObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:430
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:436
size_t roundObjectBoundary(size_t n)
Definition: RexxMemory.hpp:95
char MEMORY_POOL_STATE
Definition: RexxMemory.hpp:124
#define LargeAllocationUnit
Definition: RexxMemory.hpp:76
size_t roundLargeObjectAllocation(size_t n)
Definition: RexxMemory.hpp:96
void SetObjectLive(void *o, size_t mark)
Definition: RexxMemory.hpp:89
void holdObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:432
void discardObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:431
@ FLATTENINGOBJECT
Definition: RexxMemory.hpp:118
@ SAVINGIMAGE
Definition: RexxMemory.hpp:117
@ RESTORINGIMAGE
Definition: RexxMemory.hpp:116
@ LIVEMARK
Definition: RexxMemory.hpp:115
@ UNFLATTENINGOBJECT
Definition: RexxMemory.hpp:119
#define ObjectGrain
Definition: RexxMemory.hpp:74
void discardHoldObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:433
size_t roundObjectResize(size_t n)
Definition: RexxMemory.hpp:97
MemorySegment * spareSegment
Definition: RexxMemory.hpp:133
MemorySegmentPool * next
Definition: RexxMemory.hpp:132
MemorySegment * newLargeSegment(size_t minSize)
MemorySegment * newSegment(size_t minSize)
friend bool SysAccessPool(MemorySegmentPool **)
static MemorySegmentPool * createPool()
MemorySegmentPool * nextPool()
Definition: RexxMemory.hpp:159
void setNext(MemorySegmentPool *nextPool)
void logObject(RexxObject *obj)
virtual RexxObject * remove(RexxObject *key)
virtual RexxObject * add(RexxObject *, RexxObject *)
void setObjectLive(size_t markword)
RexxBehaviour * behaviour
static RexxDirectory * functionsDir
Definition: RexxMemory.hpp:310
char * image_buffer
Definition: RexxMemory.hpp:397
void setEnvelope(RexxEnvelope *)
void mark(RexxObject *)
void markObjectsMain(RexxObject *)
Definition: RexxMemory.cpp:360
void collect()
void addWeakReference(WeakReference *ref)
Definition: RexxMemory.cpp:729
RexxIdentityTable * old2new
Definition: RexxMemory.hpp:387
static RexxDirectory * environment
Definition: RexxMemory.hpp:309
static void definePrivateKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false)
Definition: Setup.cpp:124
void saveImageMark(RexxObject *markObject, RexxObject **pMarkObject)
void discardHoldObject(RexxInternalObject *obj)
RexxSaveStack * saveStack
Definition: RexxMemory.hpp:382
MemorySegmentPool * firstPool
Definition: RexxMemory.hpp:392
RexxMemory(RESTORETYPE restoreType)
Definition: RexxMemory.hpp:176
void removeUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:605
RexxTable * markTable
Definition: RexxMemory.hpp:384
void orphanCheckMark(RexxObject *markObject, RexxObject **pMarkObject)
size_t pendingUninits
Definition: RexxMemory.hpp:389
void restoreImage()
Definition: RexxMemory.cpp:817
static void createRexxPackage()
Definition: Setup.cpp:205
bool objectReferenceOK(RexxObject *o)
Definition: RexxMemory.cpp:337
void liveStackFull()
RexxObject * dump()
@ saveArray_FUNCTIONS
Definition: RexxMemory.hpp:339
@ saveArray_NAME_STRINGS
Definition: RexxMemory.hpp:327
@ saveArray_REXX_PACKAGE
Definition: RexxMemory.hpp:337
@ saveArray_NULLPOINTER
Definition: RexxMemory.hpp:336
@ saveArray_GLOBAL_STRINGS
Definition: RexxMemory.hpp:331
@ saveArray_PACKAGES
Definition: RexxMemory.hpp:334
@ saveArray_COMMON_RETRIEVERS
Definition: RexxMemory.hpp:340
void verboseMessage(const char *message, size_t sub1)
Definition: RexxMemory.hpp:246
void initialize(bool restoringImage, const char *imageTarget)
Definition: RexxMemory.cpp:179
void memoryPoolAdded(MemorySegmentPool *)
RexxObject * setParms(RexxObject *, RexxObject *)
void shutdown()
void saveImage(const char *imageTarget)
RexxIdentityTable * uninitTable
Definition: RexxMemory.hpp:388
void restoreObjectMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:359
WeakReference * weakReferenceList
Definition: RexxMemory.hpp:416
static RexxDirectory * globalStrings
Definition: RexxMemory.hpp:418
static void createStrings()
Definition: GlobalNames.cpp:47
RexxObject * saveObject(RexxInternalObject *saveObj)
Definition: RexxMemory.hpp:211
static void createImage(const char *imageTarget)
Definition: Setup.cpp:219
RexxObject * newObject(size_t size)
Definition: RexxMemory.hpp:190
static SysMutex unflattenMutex
Definition: RexxMemory.hpp:420
bool processingUninits
Definition: RexxMemory.hpp:390
void setMarkTable(RexxTable *marktable)
Definition: RexxMemory.hpp:225
size_t image_offset
Definition: RexxMemory.hpp:398
NormalSegmentSet newSpaceNormalSegments
Definition: RexxMemory.hpp:395
bool orphanCheck
Definition: RexxMemory.hpp:406
static void completeSystemClass(const char *name, RexxClass *classObj)
Definition: Setup.cpp:173
MemorySegment * newSegment(size_t requestLength, size_t minLength)
Definition: RexxMemory.cpp:740
bool restoringImage()
Definition: RexxMemory.hpp:218
static void * virtualFunctionTable[]
Definition: RexxMemory.hpp:301
void killOrphans(RexxObject *)
Definition: RexxMemory.cpp:395
static void defineKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false)
Definition: Setup.cpp:94
bool inSharedObjectStorage(RexxObject *obj)
Definition: RexxMemory.cpp:288
RexxObject * setDump(RexxObject *)
void checkLiveStack()
Definition: RexxMemory.hpp:345
static PackageClass * rexxPackage
Definition: RexxMemory.hpp:314
RexxObject * makeProxy(RexxEnvelope *)
static RexxArray * saveStrings()
Definition: GlobalNames.cpp:71
MemorySegment * newLargeSegment(size_t requestLength, size_t minLength)
Definition: RexxMemory.cpp:780
bool isPendingUninit(RexxObject *obj)
Definition: RexxMemory.cpp:633
void live(size_t)
Definition: RexxMemory.cpp:939
RexxArray * newObjects(size_t size, size_t count, size_t objectType)
void markGeneral(void *)
void dumpMemoryProfile()
Definition: RexxMemory.cpp:258
RexxVariable * variableCache
Definition: RexxMemory.hpp:306
RexxStack * getFlattenStack()
void addUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:616
RexxObject * popLiveStack()
Definition: RexxMemory.hpp:347
void markObjects(void)
Definition: RexxMemory.cpp:642
static void createLocks()
static RexxDirectory * system
Definition: RexxMemory.hpp:313
void restoreMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:349
static void addToSystem(const char *name, RexxInternalObject *classObj)
Definition: Setup.cpp:148
bool dumpEnable
Definition: RexxMemory.hpp:400
OldSpaceSegmentSet oldSpaceSegments
Definition: RexxMemory.hpp:394
static void restoreStrings(RexxArray *stringArray)
size_t markWord
Definition: RexxMemory.hpp:304
void setUpMemoryTables(RexxIdentityTable *old2newTable)
static void defineProtectedKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false)
Definition: Setup.cpp:108
void removeSavedObject(RexxObject *obj)
Definition: RexxMemory.hpp:266
bool savingImage()
Definition: RexxMemory.hpp:217
void collectAndUninit(bool clearStack)
Definition: RexxMemory.cpp:498
RexxObject * holdObject(RexxInternalObject *obj)
bool saveimage
Definition: RexxMemory.hpp:401
void pushLiveStack(RexxObject *obj)
Definition: RexxMemory.hpp:346
RexxObject * dumpImageStats()
size_t collections
Definition: RexxMemory.hpp:415
GlobalProtectedObject * protectedObjects
Definition: RexxMemory.hpp:307
static SysMutex envelopeMutex
Definition: RexxMemory.hpp:421
static void buildVirtualFunctionTable()
void liveGeneral(int reason)
Definition: RexxMemory.cpp:974
bool inObjectStorage(RexxObject *obj)
Definition: RexxMemory.cpp:318
RexxStack * liveStack
Definition: RexxMemory.hpp:380
LargeSegmentSet newSpaceLargeSegments
Definition: RexxMemory.hpp:396
void checkAllocs()
size_t objOffset
Definition: RexxMemory.hpp:407
void runUninits()
Definition: RexxMemory.cpp:527
void logObjectStats(RexxObject *obj)
Definition: RexxMemory.hpp:264
void verboseMessage(const char *message, const char *sub1, size_t sub2)
Definition: RexxMemory.hpp:258
static RexxString * getGlobalName(const char *value)
void returnFlattenStack()
RexxObject * checkSetOref(RexxObject *, RexxObject **, RexxObject *, const char *, int)
char * allocateImageBuffer(size_t size)
size_t allocations
Definition: RexxMemory.hpp:414
RexxEnvelope * envelope
Definition: RexxMemory.hpp:410
static void closeLocks()
void unflattenMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:354
static RexxDirectory * commonRetrievers
Definition: RexxMemory.hpp:311
RexxIdentityTable * saveTable
Definition: RexxMemory.hpp:383
void checkUninitQueue()
Definition: RexxMemory.hpp:200
void clearSaveStack()
Definition: RexxMemory.hpp:269
bool checkSetOK
Definition: RexxMemory.hpp:403
void setObjectOffset(size_t offset)
RexxStack * flattenStack
Definition: RexxMemory.hpp:381
void discardObject(RexxInternalObject *obj)
Definition: RexxMemory.hpp:212
RexxObject * gutCheck()
static void restore()
void disableOrefChecks()
Definition: RexxMemory.hpp:267
RexxObject * oldObject(size_t size)
void verboseMessage(const char *message)
Definition: RexxMemory.hpp:240
void dumpObject(RexxObject *objectRef, FILE *outfile)
Definition: RexxMemory.cpp:270
void checkWeakReferences()
Definition: RexxMemory.cpp:693
static RexxDirectory * kernel
Definition: RexxMemory.hpp:312
void enableOrefChecks()
Definition: RexxMemory.hpp:268
static SysMutex flattenMutex
Definition: RexxMemory.hpp:419
RexxDirectory * getGlobalStrings()
Definition: RexxMemory.hpp:285
RexxObject * setOref(void *index, RexxObject *value)
bool queryDump()
Definition: RexxMemory.hpp:220
void lastChanceUninit()
Definition: RexxMemory.cpp:517
RexxObject * temporaryObject(size_t size)
RexxObject * operator=(DeadObject *d)
Definition: RexxMemory.hpp:179
void verboseMessage(const char *message, size_t sub1, size_t sub2)
Definition: RexxMemory.hpp:252
void setOrphanCheck(bool orphancheck)
Definition: RexxMemory.hpp:226
RexxStack * originalLiveStack
Definition: RexxMemory.hpp:411
void reSize(RexxObject *, size_t)
MemoryStats * imageStats
Definition: RexxMemory.hpp:412
RexxObject * reclaim()
MemorySegmentPool * currentPool
Definition: RexxMemory.hpp:393
void pushSaveStack(RexxObject *obj)
Definition: RexxMemory.hpp:265
size_t relocation
Definition: RexxMemory.hpp:399
void checkUninit()
Definition: RexxMemory.cpp:460
void bumpMarkWord()
Definition: RexxMemory.hpp:348
bool restoreimage
Definition: RexxMemory.hpp:402
static void create()
void flatten(RexxEnvelope *)
Definition: RexxMemory.cpp:997
void scavengeSegmentSets(MemorySegmentSet *requester, size_t allocationLength)
void logVerboseOutput(const char *message, void *sub1, void *sub2)
Definition: RexxMemory.cpp:250
void removeHold(RexxInternalObject *obj)
Definition: RexxMemory.hpp:213
static PCPPM exportedMethods[]
Definition: RexxMemory.hpp:302
void remove(RexxObject *, bool search=false)
Definition: StackClass.cpp:226
void fastPush(RexxObject *element)
Definition: StackClass.hpp:70
RexxObject * fastPop()
Definition: StackClass.hpp:72
size_t size
Definition: StackClass.hpp:80
RexxObject * stack[1]
Definition: StackClass.hpp:82
RexxObject * push(RexxObject *obj)
Definition: StackClass.hpp:63
bool checkRoom()
Definition: StackClass.hpp:71
virtual RexxObject * unflatten(RexxEnvelope *)
int type
Definition: cmdparse.cpp:1888