Skip to content

fix: ensure wasm result buffer is always deallocated#35

Closed
Ocheretovich wants to merge 2 commits into
cdump:masterfrom
Ocheretovich:patch-3
Closed

fix: ensure wasm result buffer is always deallocated#35
Ocheretovich wants to merge 2 commits into
cdump:masterfrom
Ocheretovich:patch-3

Conversation

@Ocheretovich
Copy link
Copy Markdown
Contributor

No description provided.

@cdump
Copy link
Copy Markdown
Owner

cdump commented Mar 25, 2026

Could you please explain this change?
You replaced dealloc with deferred dealloc, but the return statement is literally on the next line, so we just added the cost of defer without any benefit

@Ocheretovich
Copy link
Copy Markdown
Contributor Author

I changed it to defer to make sure the buffer is always deallocated even if an early return is added later. But I agree it doesn’t bring a benefit in the current flow I can revert it.

@cdump
Copy link
Copy Markdown
Owner

cdump commented Mar 29, 2026

Let's skip this - the function is quite small, and even if an early return is added in the future, the chance of missing that deallocation is very small

@cdump cdump closed this Mar 29, 2026
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