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 
298  static void *virtualFunctionTable[]; /* table of virtual functions */
299  static PCPPM exportedMethods[]; /* start of exported methods table */
300 
301  size_t markWord; /* current marking counter */
302  int markReason; // reason for calling liveGeneral()
303  RexxVariable *variableCache; /* our cache of variable objects */
304  GlobalProtectedObject *protectedObjects; // specially protected objects
305 
306  static RexxDirectory *environment; // global environment
307  static RexxDirectory *functionsDir; // statically defined requires
308  static RexxDirectory *commonRetrievers; // statically defined requires
309  static RexxDirectory *kernel; // the kernel directory
310  static RexxDirectory *system; // the system directory
311 
312 private:
313 
314 /******************************************************************************/
315 /* Define location of objects saved in SaveArray during Saveimage processing */
316 /* and used during restart processing. */
317 /* Currently only used in OKMEMORY.C */
318 /******************************************************************************/
319 enum
320 {
337 };
338 
339 
340  inline void checkLiveStack() { if (!liveStack->checkRoom()) liveStackFull(); }
341  inline void pushLiveStack(RexxObject *obj) { checkLiveStack(); liveStack->fastPush(obj); }
342  inline RexxObject * popLiveStack() { return (RexxObject *)liveStack->fastPop(); }
343  inline void bumpMarkWord() { markWord ^= MarkMask; }
344  inline void restoreMark(RexxObject *markObject, RexxObject **pMarkObject) {
345  /* we update the object's location */
346  *pMarkObject = (RexxObject *)((size_t)markObject + relocation);
347  }
348 
349  inline void unflattenMark(RexxObject *markObject, RexxObject **pMarkObject) {
350  /* do the unflatten */
351  *pMarkObject = markObject->unflatten(this->envelope);
352  }
353 
354  inline void restoreObjectMark(RexxObject *markObject, RexxObject **pMarkObject) {
355  /* update the object reference */
356  markObject = (RexxObject *)((char *)markObject + objOffset);
357  markObject->setObjectLive(markWord); /* Then Mark this object as live. */
358  *pMarkObject = markObject; /* now set this back again */
359  }
360 
361 
362 /* object validation method --used to find and diagnose broken object references */
363  void saveImageMark(RexxObject *markObject, RexxObject **pMarkObject);
364  void orphanCheckMark(RexxObject *markObject, RexxObject **pMarkObject);
365 
366  bool inObjectStorage(RexxObject *obj);
368  bool objectReferenceOK(RexxObject *o);
369  void restoreImage();
370 
371  static void defineKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false);
372  static void defineProtectedKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false);
373  static void definePrivateKernelMethod(const char *name, RexxBehaviour * behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false);
374 
379  RexxTable *markTable; /* tabobjects to start a memory mark */
380  /* if building/restoring image, */
381  /*OREF_ENV, else old2new */
382  RexxIdentityTable *old2new; /* remd set */
383  RexxIdentityTable *uninitTable; // the table of objects with uninit methods
384  size_t pendingUninits; // objects waiting to have uninits run
385  bool processingUninits; // true when we are processing the uninit table
386 
387  MemorySegmentPool *firstPool; /* First segmentPool block. */
388  MemorySegmentPool *currentPool; /* Curent segmentPool being carved */
392  char *image_buffer; /* the buffer used for image save/restore operations */
393  size_t image_offset; /* the offset information for the image */
394  size_t relocation; /* image save/restore relocation factor */
395  bool dumpEnable; /* enabled for dumps? */
396  bool saveimage; /* we're saving the image */
397  bool restoreimage; /* we're restoring the image */
398  bool checkSetOK; /* OREF checking is enabled */
399  /* enabled for checking for bad */
400  /*OREF's? */
402  size_t objOffset; /* offset of arriving mobile objects */
403  /* envelope for arriving mobile */
404  /*objects */
406  RexxStack *originalLiveStack; /* original live stack allocation */
407  MemoryStats *imageStats; /* current statistics collector */
408 
409  size_t allocations; /* number of allocations since last GC */
410  size_t collections; /* number of garbage collections */
411  WeakReference *weakReferenceList; // list of active weak references
412 
413  static RexxDirectory *globalStrings; // table of global strings
414  static SysMutex flattenMutex; /* locks for various memory processes */
417 };
418 
419 
420 /******************************************************************************/
421 /* Memory management macros */
422 /******************************************************************************/
423 
424 
429 
430 
431 inline RexxObject *new_object(size_t s) { return memoryObject.newObject(s); }
432 inline RexxObject *new_object(size_t s, size_t t) { return memoryObject.newObject(s, t); }
433 
434 inline RexxArray *new_arrayOfObject(size_t s, size_t c, size_t t) { return memoryObject.newObjects(s, c, t); }
435 
436 #define setUpFlatten(type) \
437  { \
438  size_t newSelf = envelope->currentOffset; \
439  type * volatile newThis = (type *)this; // NB: This is declared volatile to avoid optimizer problems.
440 
441 #define cleanUpFlatten \
442  }
443 
444 #define ObjectNeedsMarking(oref) ((oref) != OREF_NULL && !((oref)->isObjectMarked(liveMark)) )
445 #define memory_mark(oref) if (ObjectNeedsMarking(oref)) memoryObject.mark((RexxObject *)(oref))
446 #define memory_mark_general(oref) (memoryObject.markGeneral((void *)&(oref)))
447 
448 // some convenience macros for marking arrays of objects.
449 #define memory_mark_array(count, array) \
450  for (size_t i = 0; i < count; i++) \
451  { \
452  memory_mark(array[i]); \
453  }
454 
455 #define memory_mark_general_array(count, array) \
456  for (size_t i = 0; i < count; i++) \
457  { \
458  memory_mark_general(array[i]); \
459  }
460 
461 // Following macros are for Flattening and unflattening of objects
462 // Some notes on what is going on here. The flatten() method gets called on an object
463 // after it has been moved into the envelope buffer, so the this pointer is
464 // to the copied object, not the original. On a call to flattenReference(), it might
465 // be necessary to allocate a larger buffer. When that happens, the copied object gets
466 // moved to a new location and the newThis pointer gets updated to the new object location.
467 // it is necessary to copy the this pointer and also declare the newThis pointer as volatile
468 // so that the change in pointer value doesn't get optimized out by the compiler.
469 
470 // set up for flattening. This sets up the newThis pointer and also gets some
471 // information from the envelope. The type argument allows newThis to be declared with
472 // the correct type.
473 #define setUpFlatten(type) \
474  { \
475  size_t newSelf = envelope->currentOffset; \
476  type * volatile newThis = (type *)this; // NB: This is declared volatile to avoid optimizer problems.
477 
478 // just a block closer for the block created by setUpFlatten.
479 #define cleanUpFlatten \
480  }
481 
482 // newer, simplified form. Just give the name of the field.
483 #define flattenRef(oref) if ((newThis->oref) != OREF_NULL) envelope->flattenReference((void *)&newThis, newSelf, (void *)&(newThis->oref))
484 
485 // a version for flattening arrays of objects. Give the count field and the name of the array.
486 #define flattenArrayRefs(count, array) \
487  for (size_t i = 0; i < count; i++) \
488  { \
489  flattenRef(array[i]); \
490  }
491 
492 /* Following macros are for Flattening and unflattening of objects */
493 #define flatten_reference(oref,envel) if (oref) envel->flattenReference((void *)&newThis, newSelf, (void *)&(oref))
494 
495 // declare a class creation routine
496 // for classes with their own
497 // explicit class objects
498 #define CLASS_CREATE(name, id, className) The##name##Class = (className *)new (sizeof(className), id, The##name##ClassBehaviour, The##name##Behaviour) RexxClass;
499 
500 #endif
@ T_Object
RESTORETYPE
Definition: ObjectClass.hpp:80
RexxObject *(RexxObject::* PCPPM)()
@ MarkMask
Definition: ObjectClass.hpp:73
#define RXROUNDUP(n, to)
Definition: RexxCore.h:209
RexxMemory memoryObject
Definition: RexxMemory.cpp:85
RexxArray * new_arrayOfObject(size_t s, size_t c, size_t t)
Definition: RexxMemory.hpp:434
void saveObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:425
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:431
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:427
void discardObject(RexxInternalObject *o)
Definition: RexxMemory.hpp:426
@ 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:428
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:307
char * image_buffer
Definition: RexxMemory.hpp:392
void setEnvelope(RexxEnvelope *)
void mark(RexxObject *)
void markObjectsMain(RexxObject *)
Definition: RexxMemory.cpp:353
void collect()
void addWeakReference(WeakReference *ref)
Definition: RexxMemory.cpp:722
RexxIdentityTable * old2new
Definition: RexxMemory.hpp:382
static RexxDirectory * environment
Definition: RexxMemory.hpp:306
static void definePrivateKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false)
Definition: Setup.cpp:122
void saveImageMark(RexxObject *markObject, RexxObject **pMarkObject)
void discardHoldObject(RexxInternalObject *obj)
RexxSaveStack * saveStack
Definition: RexxMemory.hpp:377
MemorySegmentPool * firstPool
Definition: RexxMemory.hpp:387
RexxMemory(RESTORETYPE restoreType)
Definition: RexxMemory.hpp:176
void removeUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:598
RexxTable * markTable
Definition: RexxMemory.hpp:379
void orphanCheckMark(RexxObject *markObject, RexxObject **pMarkObject)
size_t pendingUninits
Definition: RexxMemory.hpp:384
void restoreImage()
Definition: RexxMemory.cpp:810
bool objectReferenceOK(RexxObject *o)
Definition: RexxMemory.cpp:330
void liveStackFull()
RexxObject * dump()
@ saveArray_FUNCTIONS
Definition: RexxMemory.hpp:334
@ saveArray_NAME_STRINGS
Definition: RexxMemory.hpp:323
@ saveArray_NULLPOINTER
Definition: RexxMemory.hpp:332
@ saveArray_GLOBAL_STRINGS
Definition: RexxMemory.hpp:327
@ saveArray_PACKAGES
Definition: RexxMemory.hpp:330
@ saveArray_COMMON_RETRIEVERS
Definition: RexxMemory.hpp:335
void verboseMessage(const char *message, size_t sub1)
Definition: RexxMemory.hpp:246
void initialize(bool restoringImage, const char *imageTarget)
Definition: RexxMemory.cpp:172
void memoryPoolAdded(MemorySegmentPool *)
RexxObject * setParms(RexxObject *, RexxObject *)
void shutdown()
void saveImage(const char *imageTarget)
RexxIdentityTable * uninitTable
Definition: RexxMemory.hpp:383
void restoreObjectMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:354
WeakReference * weakReferenceList
Definition: RexxMemory.hpp:411
static RexxDirectory * globalStrings
Definition: RexxMemory.hpp:413
static void createStrings()
Definition: GlobalNames.cpp:47
RexxObject * saveObject(RexxInternalObject *saveObj)
Definition: RexxMemory.hpp:211
static void createImage(const char *imageTarget)
Definition: Setup.cpp:146
RexxObject * newObject(size_t size)
Definition: RexxMemory.hpp:190
static SysMutex unflattenMutex
Definition: RexxMemory.hpp:415
bool processingUninits
Definition: RexxMemory.hpp:385
void setMarkTable(RexxTable *marktable)
Definition: RexxMemory.hpp:225
size_t image_offset
Definition: RexxMemory.hpp:393
NormalSegmentSet newSpaceNormalSegments
Definition: RexxMemory.hpp:390
bool orphanCheck
Definition: RexxMemory.hpp:401
MemorySegment * newSegment(size_t requestLength, size_t minLength)
Definition: RexxMemory.cpp:733
bool restoringImage()
Definition: RexxMemory.hpp:218
static void * virtualFunctionTable[]
Definition: RexxMemory.hpp:298
void killOrphans(RexxObject *)
Definition: RexxMemory.cpp:388
static void defineKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false)
Definition: Setup.cpp:92
bool inSharedObjectStorage(RexxObject *obj)
Definition: RexxMemory.cpp:281
RexxObject * setDump(RexxObject *)
void checkLiveStack()
Definition: RexxMemory.hpp:340
RexxObject * makeProxy(RexxEnvelope *)
Definition: RexxMemory.cpp:988
static RexxArray * saveStrings()
Definition: GlobalNames.cpp:64
MemorySegment * newLargeSegment(size_t requestLength, size_t minLength)
Definition: RexxMemory.cpp:773
bool isPendingUninit(RexxObject *obj)
Definition: RexxMemory.cpp:626
void live(size_t)
Definition: RexxMemory.cpp:922
RexxArray * newObjects(size_t size, size_t count, size_t objectType)
void markGeneral(void *)
void dumpMemoryProfile()
Definition: RexxMemory.cpp:251
RexxVariable * variableCache
Definition: RexxMemory.hpp:303
RexxStack * getFlattenStack()
void addUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:609
RexxObject * popLiveStack()
Definition: RexxMemory.hpp:342
void markObjects(void)
Definition: RexxMemory.cpp:635
static void createLocks()
static RexxDirectory * system
Definition: RexxMemory.hpp:310
void restoreMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:344
bool dumpEnable
Definition: RexxMemory.hpp:395
OldSpaceSegmentSet oldSpaceSegments
Definition: RexxMemory.hpp:389
static void restoreStrings(RexxArray *stringArray)
Definition: GlobalNames.cpp:92
size_t markWord
Definition: RexxMemory.hpp:301
void setUpMemoryTables(RexxIdentityTable *old2newTable)
static void defineProtectedKernelMethod(const char *name, RexxBehaviour *behaviour, PCPPM entryPoint, size_t arguments, bool named_arguments=false)
Definition: Setup.cpp:106
void removeSavedObject(RexxObject *obj)
Definition: RexxMemory.hpp:266
bool savingImage()
Definition: RexxMemory.hpp:217
void collectAndUninit(bool clearStack)
Definition: RexxMemory.cpp:491
RexxObject * holdObject(RexxInternalObject *obj)
bool saveimage
Definition: RexxMemory.hpp:396
void pushLiveStack(RexxObject *obj)
Definition: RexxMemory.hpp:341
RexxObject * dumpImageStats()
size_t collections
Definition: RexxMemory.hpp:410
GlobalProtectedObject * protectedObjects
Definition: RexxMemory.hpp:304
static SysMutex envelopeMutex
Definition: RexxMemory.hpp:416
static void buildVirtualFunctionTable()
void liveGeneral(int reason)
Definition: RexxMemory.cpp:956
bool inObjectStorage(RexxObject *obj)
Definition: RexxMemory.cpp:311
RexxStack * liveStack
Definition: RexxMemory.hpp:375
LargeSegmentSet newSpaceLargeSegments
Definition: RexxMemory.hpp:391
void checkAllocs()
size_t objOffset
Definition: RexxMemory.hpp:402
void runUninits()
Definition: RexxMemory.cpp:520
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:409
RexxEnvelope * envelope
Definition: RexxMemory.hpp:405
static void closeLocks()
void unflattenMark(RexxObject *markObject, RexxObject **pMarkObject)
Definition: RexxMemory.hpp:349
static RexxDirectory * commonRetrievers
Definition: RexxMemory.hpp:308
RexxIdentityTable * saveTable
Definition: RexxMemory.hpp:378
void checkUninitQueue()
Definition: RexxMemory.hpp:200
void clearSaveStack()
Definition: RexxMemory.hpp:269
bool checkSetOK
Definition: RexxMemory.hpp:398
void setObjectOffset(size_t offset)
RexxStack * flattenStack
Definition: RexxMemory.hpp:376
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:263
void checkWeakReferences()
Definition: RexxMemory.cpp:686
static RexxDirectory * kernel
Definition: RexxMemory.hpp:309
void enableOrefChecks()
Definition: RexxMemory.hpp:268
static SysMutex flattenMutex
Definition: RexxMemory.hpp:414
RexxDirectory * getGlobalStrings()
Definition: RexxMemory.hpp:285
RexxObject * setOref(void *index, RexxObject *value)
bool queryDump()
Definition: RexxMemory.hpp:220
void lastChanceUninit()
Definition: RexxMemory.cpp:510
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:406
void reSize(RexxObject *, size_t)
MemoryStats * imageStats
Definition: RexxMemory.hpp:407
RexxObject * reclaim()
MemorySegmentPool * currentPool
Definition: RexxMemory.hpp:388
void pushSaveStack(RexxObject *obj)
Definition: RexxMemory.hpp:265
size_t relocation
Definition: RexxMemory.hpp:394
void checkUninit()
Definition: RexxMemory.cpp:453
void bumpMarkWord()
Definition: RexxMemory.hpp:343
bool restoreimage
Definition: RexxMemory.hpp:397
static void create()
void flatten(RexxEnvelope *)
Definition: RexxMemory.cpp:978
void scavengeSegmentSets(MemorySegmentSet *requester, size_t allocationLength)
void logVerboseOutput(const char *message, void *sub1, void *sub2)
Definition: RexxMemory.cpp:243
void removeHold(RexxInternalObject *obj)
Definition: RexxMemory.hpp:213
static PCPPM exportedMethods[]
Definition: RexxMemory.hpp:299
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:383