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

Function alloc_and_put

compiler/src/main/abi_bridge.rs:245–250  ·  view source on GitHub ↗

Alloc in the live VM; 0 when outside run() or OOM.

(obj: HeapObj)

Source from the content-addressed store, hash-verified

243pub unsafe extern "C" fn host_edge_encode(tag: u32, ptr: *const u8, len: u32) -> u32 {
244 // Alloc in the live VM; 0 when outside run() or OOM.
245 fn alloc_and_put(obj: HeapObj) -> u32 {
246 match with_vm(|vm| vm.heap.alloc(obj).ok()).flatten() {
247 Some(val) => put_val(val),
248 None => 0,
249 }
250 }
251 let bytes = unsafe { safe_bytes(ptr, len) };
252 match classify_encode(tag, bytes) {
253 EncodeRequest::Direct(bits) => put_val(Val(bits)),

Callers 1

host_edge_encodeFunction · 0.85

Calls 3

with_vmFunction · 0.85
put_valFunction · 0.85
allocMethod · 0.45

Tested by

no test coverage detected