Skip to content

Commit

Permalink
Fixing the allInstances primitive to take permSpace objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Feb 3, 2023
1 parent 2484e2b commit 5970390
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion smalltalksrc/VMMaker/SpurMemoryManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,10 @@ SpurMemoryManager >> allHeapEntitiesDo: aBlock [
"N.B. e.g. allObjects relies on the old/new order here."

self allOldSpaceEntitiesDo: aBlock.
self allNewSpaceEntitiesDo: aBlock
self allNewSpaceEntitiesDo: aBlock.

"In PermSpace we only have objects, so directly iterate them"
self allPermSpaceObjectsDo: aBlock
]

{ #category : #'primitive support' }
Expand Down
13 changes: 13 additions & 0 deletions smalltalksrc/VMMakerTests/VMPermanentSpaceMemoryTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ VMPermanentSpaceMemoryTest >> setUp [
self createWeakArrayClass
]

{ #category : #'tests - allocation' }
VMPermanentSpaceMemoryTest >> testAllInstancesReturnsObjectsInPermSpace [

| permanentObject allInstances |

permanentObject := self newPermanentByteObjectOfSize: 14.

allInstances := memory allInstancesOf: memory classByteArray.

self assert: (memory slotSizeOf: allInstances) equals: 1.
self assert: (memory fetchPointer: 0 ofObject: allInstances) equals: permanentObject.
]

{ #category : #'test - moving' }
VMPermanentSpaceMemoryTest >> testCompiledMethodWithMachineCodeIsNotRememberedWhenModified [

Expand Down

0 comments on commit 5970390

Please sign in to comment.