> On Oct 18, 2017, at 1:21 PM, Nicolas Cellier 
> <[email protected]> wrote:
> 
> <snip>
> 
> Should isNull be defined as you suggest in ByteArray? If the semantic is 
> #isNullPointer, then I don't think so. If it's a more general message, then 
> maybe...
> 
> What is the class of handle?

It is ByteArray.  I agree that ByteArray responding to isNull is weird.

The struct the memory maps is struct { void* data, int flags } so I can work 
around this with something like 

self data ifNil: [.....]

I have just encountered another problem.

Ben creates a type specification as a class variable to model void*[3]

VoidPointer3 := FFITypeArray ofType: 'void*' size: 3.

which produces the following accessor for data

(FFITypeArray ofType: #FFIVoid size: 3) fromHandle: (handle copyFrom: 
OFFSET_DATA to: OFFSET_DATA + 23)

This fails because the native size of void is undefined even though it is a 
void* being mapped.

I will continue to see if I can figure out why it generates this spec - 
definitely a broken assumption somewhere in here.

-Todd Blanchard

Reply via email to