Skip to content

Conversation

@CatchABus
Copy link
Contributor

@CatchABus CatchABus commented Oct 26, 2025

This PR adds functionality for creating a Reference array of structs to fill a pointer with. e.g.

        const structs = [
            new TNSSimpleStruct({x: 1, y: 2}),
            new TNSSimpleStruct({x: 3, y: 4}),
            new TNSSimpleStruct({x: 5, y: 6})
        ];
        const length = structs.length;
        const ptr = interop.alloc(interop.sizeof(TNSSimpleStruct) * length);

        const ref = new interop.Reference(TNSSimpleStruct, ptr);
        for (let i = 0; i < length; i++) {
            ref[i] = structs[i];
        }

We are still missing handling for objc classes but I think this is a good starting point.
Fixes/Closes #86

@CatchABus CatchABus marked this pull request as ready for review October 26, 2025 23:06
@NathanWalker NathanWalker added this to the 9.0 milestone Oct 26, 2025
@CatchABus CatchABus marked this pull request as draft October 27, 2025 17:33
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.

interop.Reference to Array crashes App

2 participants