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

Method put

compiler/src/abi.rs:98–106  ·  view source on GitHub ↗

Register a value. Returns a fresh handle (rc=1).

(&mut self, val: u64)

Source from the content-addressed store, hash-verified

96
97 // Register a value. Returns a fresh handle (rc=1).
98 pub fn put(&mut self, val: u64) -> u32 {
99 if let Some(idx) = self.free_list.pop() {
100 self.slots[idx as usize] = HandleSlot { val, rc: 1 };
101 idx + 1
102 } else {
103 self.slots.push(HandleSlot { val, rc: 1 });
104 self.slots.len() as u32
105 }
106 }
107
108 // Look up a value by handle, or `None` if invalid / freed.
109 pub fn get(&self, h: u32) -> Option<u64> {

Callers 5

idb.jsFile · 0.80
put_valFunction · 0.80
putBytesMethod · 0.80
saveLockfileMethod · 0.80
setVersionMethod · 0.80

Calls 3

pushMethod · 0.80
popMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected