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

Method alloc_set

compiler/src/modules/vm/builtins/container.rs:44–48  ·  view source on GitHub ↗
(&mut self, items: Vec<Val>)

Source from the content-addressed store, hash-verified

42 }
43
44 fn alloc_set(&mut self, items: Vec<Val>) -> Result<Val, VmErr> {
45 let mut set = ValSet::with_capacity(items.len());
46 for v in items { set.insert(v, &self.heap); }
47 self.heap.alloc(HeapObj::Set(Rc::new(RefCell::new(set))))
48 }
49
50 // Build a tuple Val from items. Shared by the VM and the plugin ABI.
51 pub(crate) fn tuple_from_items(&mut self, items: Vec<Val>) -> Result<Val, VmErr> {

Callers 3

alloc_and_push_setMethod · 0.80
set_from_itemsMethod · 0.80
call_setMethod · 0.80

Calls 3

insertMethod · 0.80
lenMethod · 0.45
allocMethod · 0.45

Tested by

no test coverage detected