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.
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 whereSimpleJITBackend
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