-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi
Description
When working with a C API that takes structs by value users need to malloc
structs in C memory before they can pass them to a C function call, and remember to free the afterwards.
Instead, we should explore changing the API so that the default is that we create structs backed by TypedData
rather than allocating them in C memory.
The same argument can be made for Array
s.
TODO: Design an API taking the following into account:
- Users subtype Struct, do they need to create factories/constructors?
- How does the no-argument const default constructor interact with this? We need the consts for annotations. But the non-name constructor would be an ideal candidate for this behavior.
TimWhiting, point-source, safasofuoglu, blaugold and halildurmus
Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi