Skip to main content

ss_resource_create_borrow

Function ss_resource_create_borrow 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ss_resource_create_borrow( ptr: *const c_uchar, len: usize, ) -> *mut c_void
Expand description

Create a resource that reads the len bytes at ptr in place, with no copy. Release it with ss_resource_destroy. Returns null for a null ptr or a pack of another schema version.

§Security and Validation

To maximize performance and minimize binary size, libssruntime does not validate the input .ssab data. Passing corrupted or maliciously crafted data will cause undefined behavior (e.g., out-of-bounds reads). The caller MUST ensure the data is trusted or validated before passing it to this function.

§Safety

ptr must point to len readable bytes, which stay valid and unmodified until this handle is destroyed and no context or effect slot holds the resource.