alexcrichton transferred Issue #565:
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 17:03 UTC