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: Grant host engine control over memory #70

Closed
wants to merge 5 commits into from
Closed

Conversation

AndrewSisley
Copy link
Collaborator

@AndrewSisley AndrewSisley commented Nov 17, 2023

Relevant issue(s)

Resolves #62

Description

Adds a new free function to the wasm interface.

This gives the host engine control over when allocated memory is freed - right now this means memory is allocated immediately prior to passing items to the wasm module, and then freed when receiving the result.

I missed this when I renamed the file, should have been done in an earlier PR
It will shortly be used in the memory tests.
This will be used shortly by more tests.  The extraction is still really really minimal - it does what it needs to do now and is no fancier.  In the future we may want to do more with it, but not now.  The code is a cut and paste, plus fixing the references to memory.
Adds a 'free' function to lenses, and gives the host engine control over when allocated memory is freed - right now this means memory is allocated immediately prior to passing items to the wasm module, and then freed when recieving the result. Tests are added in a later commit.
@AndrewSisley AndrewSisley self-assigned this Nov 17, 2023
@AndrewSisley AndrewSisley changed the title feature: Grant host engine control over memory feat: Grant host engine control over memory Nov 17, 2023
@AndrewSisley AndrewSisley changed the title feat: Grant host engine control over memory feat: Grant host engine control over memory Nov 17, 2023
@AndrewSisley AndrewSisley force-pushed the 62-free-mem branch 2 times, most recently from 938e9f7 to 60f9638 Compare November 17, 2023 21:24
These tests do some basic testing of the memory management stuff.
@AndrewSisley
Copy link
Collaborator Author

Closing this for now, as the enumerable stuff (#33) will bring free back into the module, most of this code will be brought into that branch.

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.

Lens module memory management is broken
1 participant