[Vm-dev] VM Maker: ImageFormat-dtl.49.mcz

K K Subbu kksubbu.ml at gmail.com
Sun Jan 10 06:00:50 UTC 2021


On 10/01/21 5:39 am, commits at source.squeak.org wrote:
> + ----- Method: CogImageFileHeader>>readFieldsFrom:littleEndian:into: (in category 'reading') -----
> + readFieldsFrom: aStream littleEndian: littleEndian into: aCollection

Passing endian flag to every read looks like an overkill, doesn't it?

> + 			[ 16r00001966 "6502" ] -> [ imageFormat := ImageFormat fromInteger: 6502. littleEndian := false ] .

The endianness is fixed when the imageFormat is instantiated. If it 
could be encapsulated as part of this instance, then there is no need to 
pass it as an argument for every read from the store associated with 
this image instance.

Ideally, the image store type (little/big endian) should be separated 
from the image encoding format (32-bit, 64-bit, ....). But I guess this 
separation can evolve over time.

Regards .. Subbu


More information about the Vm-dev mailing list