luaur_code_gen/functions/
destroy_shared_code_gen_context.rs1use crate::records::shared_code_gen_context::SharedCodeGenContext;
2
3#[no_mangle]
9pub unsafe extern "C" fn destroy_shared_code_gen_context(
10 code_gen_context: *const SharedCodeGenContext,
11) {
12 if !code_gen_context.is_null() {
13 let ptr = code_gen_context as *mut SharedCodeGenContext;
14 unsafe {
15 core::ptr::drop_in_place(ptr);
16 alloc::alloc::dealloc(
17 ptr as *mut u8,
18 core::alloc::Layout::new::<SharedCodeGenContext>(),
19 );
20 }
21 }
22}