[Vm-dev] byteSizeOf: is that correct for 64bit images? Also what about the (sqInt)(long)

John M McIntosh johnmci at smalltalkconsulting.com
Sun Dec 20 22:45:59 UTC 2009


Ok, I have to ask, is this correct?    Er 4 or 8 or does it matter, do we have other '4' values embedded in the interpreter? 
byteSizeOf: oop
	| slots |
self flag: #Dan.
	(self isIntegerObject: oop) ifTrue:[^0].
	slots := self slotSizeOf: oop.
	(self isBytesNonInt: oop)
		ifTrue:[^slots]
		ifFalse:[^slots * 4]




Also what about 
	byteSize := interpreterProxy byteSizeOf: fontFilePath cPtrAsOop.

where we have, note the (sqInt)(long) 

generateCPtrAsOop: aNode on: aStream indent: anInteger

	aStream nextPutAll: '((sqInt)(long)('.
	self emitCExpression: aNode receiver on: aStream.
	aStream nextPutAll: ') - ';
		nextPutAll: ObjectMemory baseHeaderSize printString;
		nextPut: $).

Translates to 
	byteSize = interpreterProxy->byteSizeOf(((sqInt)(long)(fontFilePath) - 4));

which of course is wrong. 

See http://bugs.squeak.org/view.php?id=7431

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






More information about the Vm-dev mailing list