FFI failing on 64bits (macOS) ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FFI failing on 64bits (macOS) ?

EstebanLM
 
Hello,

I’m testing image and vm on 64bits, to make sure FFI works (most of it works out of the box)
But I have this test:

| ref int |

int := 2147483648.
ref := ByteArray new: 8.
ref signedLongLongAt: 1 put: int.
self assert: (ref signedLongLongAt: 1) = int

and I have a PrimitiveFailed error on

ByteArray>>unsignedLongAt: byteOffset put: value
        "Store a 32bit signed integer starting at the given byte offset"
        ^self integerAt: byteOffset put: value size: 4 signed: false

So… is that an error or is like that and my test is bad?

Esteban

Reply | Threaded
Open this post in threaded view
|

Re: FFI failing on 64bits (macOS) ?

EstebanLM
 
meh… this one is easier and also fails:

(ByteArray new: 8) unsignedLongLongAt: 1 put: 1.

Esteban

> On 4 Nov 2016, at 14:22, Esteban Lorenzano <[hidden email]> wrote:
>
> Hello,
>
> I’m testing image and vm on 64bits, to make sure FFI works (most of it works out of the box)
> But I have this test:
>
> | ref int |
>
> int := 2147483648.
> ref := ByteArray new: 8.
> ref signedLongLongAt: 1 put: int.
> self assert: (ref signedLongLongAt: 1) = int
>
> and I have a PrimitiveFailed error on
>
> ByteArray>>unsignedLongAt: byteOffset put: value
> "Store a 32bit signed integer starting at the given byte offset"
> ^self integerAt: byteOffset put: value size: 4 signed: false
>
> So… is that an error or is like that and my test is bad?
>
> Esteban
>