Stream: git-cranelift

Topic: cranelift / Issue #565 SimpleJIT returns functions with u...


view this post on Zulip GitHub (Feb 28 2020 at 23:25):

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 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 17:03 UTC