Hi,
I found that this change:
unsignedLongLongAt: byteOffset "Answer a 64-bit integer in Smalltalk order (little-endian)." ^self integerAt: byteOffset size: 8 signed: false
unsignedLongLongAt: byteOffset put: value "I store 64-bit integers in Smalltalk (little-endian) order." ^self integerAt: byteOffset put: value size: 8 signed: false
… which makes sense at fist sight does not work at least for me. In 32bits scenario, this test will fail:
{ -9223372036854775808. -9223372036854775807. -2147483649. -2147483648. -2147483647. -32769. -32768. -32767. -129. -128. -127. 0. 126. 127. 128. 254. 255. 256. 32766. 32767. 32768. 65534. 65535. 65536. 2147483646. 2147483647. 2147483648. 9223372036854775806. 9223372036854775807 } do: [ :int | |ref| ref := ByteArray new: 8. ref signedLongLongAt: 1 put: int. self assert: (ref signedLongLongAt: 1) = int ]
can you confirm it?
cheers, Esteban
Hi Esteban, primitiveFFIIntegerAtPut can't operate on 64 int in a 32 bits vm as it is now. I'll commit a fix.
2017-01-05 9:59 GMT+01:00 Esteban Lorenzano estebanlm@gmail.com:
Hi,
I found that this change:
unsignedLongLongAt: byteOffset "Answer a 64-bit integer in Smalltalk order (little-endian)." ^self integerAt: byteOffset size: 8 signed: false
unsignedLongLongAt: byteOffset put: value "I store 64-bit integers in Smalltalk (little-endian) order." ^self integerAt: byteOffset put: value size: 8 signed: false
… which makes sense at fist sight does not work at least for me. In 32bits scenario, this test will fail:
{ -9223372036854775808. -9223372036854775807. -2147483649. -2147483648. - 2147483647. -32769. -32768. -32767. -129. -128. -127. 0. 126. 127. 128. 254. 255. 256. 32766. 32767. 32768. 65534. 65535. 65536. 2147483646. 2147483647. 2147483648. 9223372036854775806. 9223372036854775807 } do: [ :int | |ref| ref := ByteArray new: 8. ref signedLongLongAt: 1 put: int. self assert: (ref signedLongLongAt: 1) = int ]
can you confirm it?
cheers, Esteban
vm-dev@lists.squeakfoundation.org