Skip to main content

jit_v2_string_alloc

Function jit_v2_string_alloc 

Source
#[unsafe(no_mangle)]
pub extern "C" fn jit_v2_string_alloc( data: *const u8, len: u32, ) -> *mut u8
Expand description

Allocate a new StringObj from raw UTF-8 bytes. Returns a raw pointer to the StringObj (which the JIT treats as *mut u8 / I64).

The string data is copied into a buffer allocated immediately after the header, so the caller does not need to keep data alive.

Refcount is initialised to 1.