--- a/ObjectMemory.st Wed Sep 30 19:35:28 2015 +0200
+++ b/ObjectMemory.st Wed Sep 30 19:36:08 2015 +0200
@@ -1855,49 +1855,6 @@
^ nil
!
-preventTenureOf:anObject
- "set the age of anObject to the never-tenure special age.
- This prevents the object from ever going out of the new space,
- and if used without care may lead to a filling of th newspace to a point,
- where the system becomes inoperable.
- Therefore it should only be used in very special situations.
- One such situation may be to ensure that an object is finalized early by the next
- scavenge, and not by a (possibly late) old space collect.
- To undo this setup (i.e. to allow the object to tenure again), set its age back to
- any value with the seatAgeOf:to: message.
- If the object is already old, this call has no effect.
- WARNING: this method is for ST/X experts only
- it is dangerous, should be used with care
- and it may be removed without notice"
-
-%{ /* NOCONTEXT */
-#ifndef __SCHTEAM__
- if (__isNonNilObject(anObject)) {
- _SET_AGE(anObject, NO_TENURE_AGE);
- }
-#endif
-%}
- "
- |p|
- p := Point new.
- Transcript showCR:(ObjectMemory preventTenureOf:p).
- ObjectMemory tenuringScavenge.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenure.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenure.
- ObjectMemory tenure.
- ObjectMemory tenure.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory setAgeOf:p to:30.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenure.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenure.
- Transcript showCR:(ObjectMemory ageOf:p).
- "
-!
-
printReferences:anObject
"for debugging: print referents to anObject.
WARNING: this method is for ST/X debugging only
@@ -2049,43 +2006,6 @@
"Modified: / 4.2.1998 / 22:03:36 / cg"
!
-setAgeOf:anObject to:newAge
- "change the age of anObject.
- This counts the number of scavenges that an object has survived in new space.
- For old space objects, this is a no-op.
- WARNING: this method is for ST/X debugging only
- it may be removed without notice"
-
-%{ /* NOCONTEXT */
-#ifndef __SCHTEAM__
- if (__isNonNilObject(anObject) && __isSmallInteger(newAge)) {
- int age = __intVal(newAge);
-
- if (age < 0) age = 0;
- else if (age > AGE_MAX) age = AGE_MAX;
- _SET_AGE(anObject, age);
- }
-#endif
-%}
- "
- |p|
- p := Point new.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenuringScavenge.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenuringScavenge.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenuringScavenge.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenuringScavenge.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory setAgeOf:p to:0.
- Transcript showCR:(ObjectMemory ageOf:p).
- ObjectMemory tenuringScavenge.
- Transcript showCR:(ObjectMemory ageOf:p).
- "
-!
-
sizeOf:anObject
"return the size of anObject in bytes.
(this is not the same as 'anObject size').
@@ -3554,6 +3474,86 @@
"
!
+preventTenureOf:anObject
+ "set the age of anObject to the never-tenure special age.
+ This prevents the object from ever going out of the new space,
+ and if used without care may lead to a filling of th newspace to a point,
+ where the system becomes inoperable.
+ Therefore it should only be used in very special situations.
+ One such situation may be to ensure that an object is finalized early by the next
+ scavenge, and not by a (possibly late) old space collect.
+ To undo this setup (i.e. to allow the object to tenure again), set its age back to
+ any value with the seatAgeOf:to: message.
+ If the object is already old, this call has no effect.
+ WARNING: this method is for ST/X experts only
+ it is dangerous, should be used with care
+ and it may be removed without notice"
+
+%{ /* NOCONTEXT */
+#ifndef __SCHTEAM__
+ if (__isNonNilObject(anObject)) {
+ _SET_AGE(anObject, NO_TENURE_AGE);
+ }
+#endif
+%}
+ "
+ |p|
+ p := Point new.
+ Transcript showCR:(ObjectMemory preventTenureOf:p).
+ ObjectMemory tenuringScavenge.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenure.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenure.
+ ObjectMemory tenure.
+ ObjectMemory tenure.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory setAgeOf:p to:30.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenure.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenure.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ "
+!
+
+setAgeOf:anObject to:newAge
+ "change the age of anObject.
+ This counts the number of scavenges that an object has survived in new space.
+ For old space objects, this is a no-op.
+ WARNING: this method is for ST/X debugging only
+ it may be removed without notice"
+
+%{ /* NOCONTEXT */
+#ifndef __SCHTEAM__
+ if (__isNonNilObject(anObject) && __isSmallInteger(newAge)) {
+ int age = __intVal(newAge);
+
+ if (age < 0) age = 0;
+ else if (age > AGE_MAX) age = AGE_MAX;
+ _SET_AGE(anObject, age);
+ }
+#endif
+%}
+ "
+ |p|
+ p := Point new.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenuringScavenge.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenuringScavenge.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenuringScavenge.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenuringScavenge.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory setAgeOf:p to:0.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ ObjectMemory tenuringScavenge.
+ Transcript showCR:(ObjectMemory ageOf:p).
+ "
+!
+
tenureParameters:magic
"this is pure magic and not for public eyes ...
This method allows fine tuning the scavenger internals,