Skip to main content

create_orc_context

Function create_orc_context 

Source
pub(crate) fn create_orc_context() -> (&'static Context, ThreadSafeContext, Box<ManuallyDrop<Context>>)
Expand description

Creates an ORC-owned LLVM context, returning a &'static reference to it.

In JIT mode, ORC owns the context via a orc::ThreadSafeContext so that modules can be safely transferred to the JIT. A non-owning handle (ManuallyDrop<Context>) is heap-allocated to provide a stable address for the &'static reference.