MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / safe_handles

Function safe_handles

compiler/src/main/mod.rs:145–148  ·  view source on GitHub ↗

Same for `&[u32]` argv arrays. */

(ptr: *const u32, len: u32)

Source from the content-addressed store, hash-verified

143
144/* Same for `&[u32]` argv arrays. */
145pub(super) unsafe fn safe_handles<'a>(ptr: *const u32, len: u32) -> &'a [u32] {
146 if ptr.is_null() || len == 0 { return &[]; }
147 unsafe { core::slice::from_raw_parts(ptr, len as usize) }
148}
149
150/* Owned UTF-8 string from an FFI `(ptr, len)`; empty on null or invalid UTF-8. */
151pub(super) unsafe fn safe_str_owned(ptr: *const u8, len: u32) -> String {

Callers 1

host_edge_opFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected