You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is says on the tin: ususally JITs can't ever deallocate JIT bodies without explicit safepoints, since another thread could be currently executing the code and would segfault.
Since we JIT closures, and are using Rust where everything has explicit lifetimes, we can actually always deallocate the JIT code when the Fn goes out of scope, since by definition it is unreachable from any code. Also we don't have any multi-threading support yet lol.
Get rid of the mem::forget(f) in JIT compilation and store the original function in the FastFn instead, too, so that we properly run destructors of the members of the closed environment.
The text was updated successfully, but these errors were encountered:
I meant more that the fact that FastFn doesn't implement Send+Sync means that there are no cases in which a closure is being dropped while we are compiling other closures or running it. I think we'd have to worry about that in the event of e.g. #12 being implemented; it'd have to make sure to use reference-counted closures in order to make sure that everything stays alive while it is doing work on another thread, for example. That would have to add Send+Sync(?) bounds to
or something in order to make sure the closure is safe to access from whatever async worker thread, but not this work, and I'm not sure if it makes sense to make FastFn itself Send+Sync if we don't need to either.
Basically I was just being cheeky and the fact that we aren't caring about multithreading at all currently makes this easy.
What is says on the tin: ususally JITs can't ever deallocate JIT bodies without explicit safepoints, since another thread could be currently executing the code and would segfault.
Since we JIT closures, and are using Rust where everything has explicit lifetimes, we can actually always deallocate the JIT code when the Fn goes out of scope, since by definition it is unreachable from any code. Also we don't have any multi-threading support yet lol.
Get rid of the
mem::forget(f)
in JIT compilation and store the original function in the FastFn instead, too, so that we properly run destructors of the members of the closed environment.The text was updated successfully, but these errors were encountered: