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

fix: free parameters to host functions when using the host_fn macro #77

Merged
merged 2 commits into from
Mar 21, 2025

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Mar 21, 2025

  • Avoids exhausting memory when making lots of host function calls, host_fn arguments are currently not freed and are not accessible to the user to free
  • Adds the ManagedMemory type that can be used to free a memory block when dropped

@zshipko zshipko requested a review from chrisdickinson as a code owner March 21, 2025 02:07
@Pascal-So
Copy link

Can confirm that this fixes the issue that I posted in the discord, thank you for the quick fix!

Copy link
Contributor

@chrisdickinson chrisdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great catch!

@zshipko zshipko merged commit 783a0b4 into main Mar 21, 2025
2 checks passed
@zshipko zshipko deleted the managed-memory branch March 21, 2025 16:51
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.

3 participants