Skip to content

First version of FFIStructFieldSlot (WIP)#3

Draft
tinchodias wants to merge 1 commit into
pharo-cig:mainfrom
tinchodias:FFIStructFieldSlot
Draft

First version of FFIStructFieldSlot (WIP)#3
tinchodias wants to merge 1 commit into
pharo-cig:mainfrom
tinchodias:FFIStructFieldSlot

Conversation

@tinchodias

Copy link
Copy Markdown
Contributor

No description provided.

@tinchodias

tinchodias commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

There is a key difference: instead of double-dispatching on the types to generate the accessors at "rebuild accessors" time, in this version the types are kept live, pointed by the slots and #basicHandle:at:put: and #basicHandle:at: are sent by the slot on each read and write.

@tinchodias

Copy link
Copy Markdown
Contributor Author

The tests re copied and adapted from another UnifiedFFI test suite.
My image was broken so I just commit the code to run in another fresh image in the future.
So far, this was my test:

source := SDL_Point.

target := source duplicateClassWithNewName: (source name, UUID new asString36) asSymbol.
target convertToFFIFieldSlots.

instance := target new.
instance x: 12.
instance y: 17.

self assert: (target slots collect: [ :each | each read: instance ]) = #(12 17).

"Tear down:"
instance := nil.
target removeFromSystem. target := nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant