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: Create statically compiled Swift closure wrapper to avoid C-style function pointers #440

Merged
merged 13 commits into from
Dec 20, 2024

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Dec 20, 2024

Instead of bending C-style function pointer magic, I rewrote the function parsing logic to use statically generated classes instead.

This might result in better performance, but is also much safer and has more stability as the memory is strongly referenced using ARC.

Previously we counted references on an unsafe void*.

Additionally, it might fix the malloc: Heap corruption detected *** crash reported in #433! 👀

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
nitro-docs ⬜️ Skipped (Inspect) Dec 20, 2024 11:41am

@mrousavy
Copy link
Owner Author

cc @ChrisSchofieldCheckatrade try this

@mrousavy mrousavy merged commit 699e138 into main Dec 20, 2024
14 checks passed
@mrousavy mrousavy changed the title feat: Create Swift closure wrapper feat: Create statically compiled Swift closure wrapper to avoid C-style function pointers Dec 20, 2024
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