Stream: git-wasmtime

Topic: wasmtime / Issue #1058 SimpleJIT returns functions with u...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2021 at 17:06):

bjorn3 commented on Issue #1058:

You now have to explicitly call JITModule::free_memory to deallocate the memory. Dropping won't deallocate any functions or data objects.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 22 2021 at 16:48):

abrown closed Issue #1058:

Docs don't make it particularly clear who owns finalised functions and data returned from SimpleJITBackend.

From the code it looks like they are all pointers into a shared block of memory owned by SimpleJITBackend, but, if so, definitions don't even try to help with detecting cases where SimpleJITBackend is dropped but result remains.

One way to avoid this would be to reduce usages of raw pointers in SimpleJITBackend (they are really rather unnecessary hazards in that particular case) and instead return lifetime-annotated structures which can be further casted into a required function, which would allow to get proper compiler errors in case of dropping owner too early.


Last updated: Nov 22 2024 at 16:03 UTC