MCPcopy Index your code
hub / github.com/endbasic/endbasic / do_alloc

Method do_alloc

core/src/vm/context.rs:607–612  ·  view source on GitHub ↗

Implements the `Alloc` opcode.

(&mut self, instr: u32, heap: &mut Heap)

Source from the content-addressed store, hash-verified

605
606 /// Implements the `Alloc` opcode.
607 pub(super) fn do_alloc(&mut self, instr: u32, heap: &mut Heap) {
608 let (dest, etype) = bytecode::parse_alloc(instr);
609 debug_assert_eq!(ExprType::Text, etype, "Alloc is only emitted for strings right now");
610 self.set_reg(dest, heap.empty_text_ptr());
611 self.pc += 1;
612 }
613
614 /// Implements the `AllocArray` opcode.
615 pub(super) fn do_alloc_array(&mut self, instr: u32, heap: &mut Heap) {

Callers 1

execMethod · 0.80

Calls 2

set_regMethod · 0.80
empty_text_ptrMethod · 0.80

Tested by

no test coverage detected