in Spur, primitiveGarbageCollect answers the largest free chunk in oldSpace, not the total free space. This is done so that handleFailingBasicNew: et al can determine whether memory should be grown before an allocation is retried:
handleFailingBasicNew: sizeRequested
"handleFailingBasicNew: gets sent after basicNew: has failed and allowed
a scavenging garbage collection to occur. The scavenging collection
will have happened as the VM is activating the (failing) basicNew:. If
handleFailingBasicNew: fails then the scavenge failed to reclaim sufficient
space and a global garbage collection is required. Retry after garbage
collecting and growing memory if necessary.
Primitive. Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested. Fail if this class is not
indexable or if the argument is not a positive Integer, or if there is not
enough memory available. Essential. See Object documentation whatIsAPrimitive."
<primitive: 71>
| bytesRequested |
bytesRequested := self byteSizeOfInstanceOfSize: sizeRequested.
Smalltalk garbageCollect < bytesRequested ifTrue:
[Smalltalk growMemoryByAtLeast: bytesRequested].
"retry after global garbage collect and possible grow"
^self handleFailingFailingBasicNew: sizeRequested
Further, primBytesLeft answers the amount of free old space, excluding newSpace entirely. newSpace is continually changing its capacity as allocation and scavenging continues, so IMO including that information introduces noise.
But you point out that both methods should be commented accurately in Spur. I'll make it so.