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

Method alloc_list

compiler/src/modules/vm/builtins/container.rs:16–18  ·  view source on GitHub ↗

Allocate a List from items and push. Centralises the Rc::new(RefCell::new(items)) construction inlined. */

(&mut self, items: Vec<Val>)

Source from the content-addressed store, hash-verified

14
15 /* Allocate a List from items and push. Centralises the Rc::new(RefCell::new(items)) construction inlined. */
16 pub(crate) fn alloc_list(&mut self, items: Vec<Val>) -> Result<Val, VmErr> {
17 self.heap.alloc(HeapObj::List(Rc::new(RefCell::new(items))))
18 }
19
20 /* Allocate a List, push it, return Ok. */
21 pub(crate) fn alloc_and_push_list(&mut self, items: Vec<Val>) -> Result<(), VmErr> {

Callers 2

alloc_and_push_listMethod · 0.80
unpack_exMethod · 0.80

Calls 1

allocMethod · 0.45

Tested by

no test coverage detected