--- a/Behavior.st Sat Dec 18 01:15:58 1993 +0100
+++ b/Behavior.st Mon Dec 20 00:40:23 1993 +0100
@@ -38,7 +38,7 @@
NOTICE: layout known by compiler and runtime system; be careful when changing
-$Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.6 1993-12-11 00:41:45 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.7 1993-12-19 23:39:39 claus Exp $
written Dec 88 by claus
'!
@@ -151,15 +151,15 @@
nInstVars = _intVal(_INST(instSize));
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ);
if (_CanDoQuickAlignedNew(instsize)) {
- _qCheckedAlignedNew(newobj, instsize);
- /* stupid: c-compilers should find this out themselfes ... */
- goto ok;
+ _qCheckedAlignedNew(newobj, instsize);
+ /* stupid: c-compilers should find this out themselfes ... */
+ goto ok;
} else {
PROTECT_CONTEXT
newobj = new(instsize, SENDER);
UNPROTECT_CONTEXT
}
-
+
if (newobj != nil) {
ok:
_InstPtr(newobj)->o_class = self;
@@ -212,14 +212,14 @@
if (_isSmallInteger(anInteger)) {
nindexedinstvars = _intVal(anInteger);
if (nindexedinstvars >= 0) {
- PROTECT_CONTEXT
+ PROTECT_CONTEXT
nInstVars = _intVal(_INST(instSize));
flags = _intVal(_INST(flags)) & ARRAYMASK;
switch (flags) {
case BYTEARRAY:
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ) + nindexedinstvars * sizeof(char);
_qNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -248,7 +248,7 @@
case WORDARRAY:
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ) + nindexedinstvars * sizeof(short);
_qNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -272,7 +272,7 @@
case LONGARRAY:
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ) + nindexedinstvars * sizeof(long);
_qAlignedNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -303,7 +303,7 @@
case FLOATARRAY:
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ) + nindexedinstvars * sizeof(float);
_qNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -320,7 +320,7 @@
case DOUBLEARRAY:
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ) + nindexedinstvars * sizeof(double);
_qNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -339,7 +339,7 @@
nInstVars += nindexedinstvars;
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ);
_qAlignedNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -369,7 +369,7 @@
if (nindexedinstvars == 0) {
instsize = OHDR_SIZE + nInstVars * sizeof(OBJ);
_qAlignedNew(newobj, instsize, SENDER);
- UNPROTECT_CONTEXT
+ UNPROTECT_CONTEXT
if (newobj == nil) {
break;
}
@@ -759,6 +759,25 @@
]
].
^ coll asArray
+
+ "ScrollBar allInstances"
+!
+
+allDerivedInstances
+ "return a collection of all instances of myself and
+ instances of all subclasses of myself"
+
+ |coll|
+
+ coll := OrderedCollection new.
+ ObjectMemory allObjectsDo:[:anObject |
+ (anObject isKindOf:self) ifTrue:[
+ coll add:anObject
+ ]
+ ].
+ ^ coll asArray
+
+ "View allDerivedInstances"
!
instanceCount