Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ext/ffi): Struct-by-value passing #17098

Closed
wants to merge 9 commits into from

Conversation

aapoalas
Copy link
Collaborator

@aapoalas aapoalas commented Dec 17, 2022

Rebased @DjDeveloperr 's #15060 PR and solved some issues regarding struct passing in asynchronous FFI calls (libffi changes required, which is why the dependency is updated) and nested struct alignment calculation.

Proper tests for the feature are implemented, and the branch has also seen live use as the test-bed for my libclang bindings, where it has functioned without any hiccups. The branch has also received some brute-force memory leak testing through a while-loop of calling a Deno.UnsafeCallback using a Deno.UnsafeFnPointer with both the parameter and return value of the function being a struct. Memory usage of the deno process does not increase at all, staying nicely at 0.3% even after >1 minute of 100% CPU usage.

Co-authored-by: @DjDeveloperr ([email protected])

@aapoalas aapoalas force-pushed the feat/ext-ffi/struct-by-value branch 3 times, most recently from 51bcf85 to 097c072 Compare January 2, 2023 21:04
@aapoalas aapoalas force-pushed the feat/ext-ffi/struct-by-value branch from 097c072 to 9f8bc42 Compare January 2, 2023 21:05
@aapoalas aapoalas marked this pull request as ready for review January 2, 2023 21:15
@littledivy
Copy link
Member

Landed in ad82918.

@littledivy littledivy closed this Jan 15, 2023
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.

2 participants