Skip to main content

luaur_code_gen/functions/
create_code_gen_context_alt_c.rs

1use crate::type_aliases::allocation_callback::AllocationCallback;
2use crate::type_aliases::lua_state::lua_State;
3
4/// Create a standalone native-codegen context and wire its execution callbacks.
5///
6/// **Out of scope.** Native code *execution* is not part of luaur's validated
7/// surface — the bytecode interpreter is the execution oracle (see
8/// docs/CONFORMANCE.md). The C++ setup (`StandaloneCodeGenContext`,
9/// `BaseCodeGenContext::initHeaderFunctions`, `initializeExecutionCallbacks`) was
10/// never ported to Rust; it survived only as `extern` declarations of the
11/// original C++ mangled symbols, which have no implementation to link against.
12/// lld dead-code-eliminated those phantom references on Linux/macOS, but the MSVC
13/// linker kept them and failed ("unresolved external symbol"). Replacing the
14/// phantom externs with an explicit stub keeps the symbol set honest and lets the
15/// workspace link on every platform.
16#[allow(unused_variables)]
17pub fn create_lua_state_usize_usize_allocation_callback_void(
18    l: *mut lua_State,
19    block_size: usize,
20    max_total_size: usize,
21    allocation_callback: *mut AllocationCallback,
22    allocation_callback_context: *mut core::ffi::c_void,
23) {
24    unimplemented!(
25        "luaur does not execute JIT-compiled native code (out of scope; see docs/CONFORMANCE.md)"
26    )
27}