Skip to main content

luaur_code_gen/functions/
log_perf_function.rs

1use core::ffi::c_void;
2
3#[allow(non_snake_case)]
4pub(crate) fn log_perf_function(p: *mut c_void, addr: usize, size: u32) {
5    // NOTE: This is a native-only debug/perf logging hook.
6    //
7    // The original C++ reads fields from a Luau `Proto` and conditionally
8    // forwards a formatted string to `gPerfLogFn`.
9    //
10    // This one-shot translation avoids depending on `Proto`/`TString` layout
11    // in this module. Preserve the "must have non-null p" behavior by
12    // asserting without using CODEGEN_ASSERT (the crate build for this
13    // workspace doesn't provide the referenced symbols).
14    if p.is_null() {
15        panic!("log_perf_function called with null p");
16    }
17
18    let _ = addr;
19    let _ = size;
20}