-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 'Fix memory leaks, make extension types more efficient' from Pr…
…eston Thorpe I was baffled previously, because any time that `free` was called on a type from an extension, it would hang even when I knew it wasn't in use any longer, and hadn't been double free'd. After #737 was merged, I tried it again and noticed that it would no longer hang... but only for extensions that were staticly linked. Then I realized that we are using a global allocator, that likely wasn't getting used in the shared library that is built separately that won't inherit from our global allocator in core, causing some symbol mismatch and the subsequent hanging on calls to `free`. This PR adds the global allocator to extensions behind a feature flag in the macro that will prevent it from being used in `wasm` and staticly linked environments where it would conflict with limbos normal global allocator. This allows us to properly free the memory from returning extension functions over FFI. This PR also changes the Extension type to a union field so we can store int + float values inline without boxing them. any additional tips or thoughts anyone else has on improving this would be appreciated 👍 Closes #803
- Loading branch information
Showing
12 changed files
with
261 additions
and
184 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.