Skip to main content

luaur_bytecode/methods/
call_inliner_allocate_vm_consts.rs

1use crate::records::call_inliner::CallInliner;
2
3impl<'a> CallInliner<'a> {
4    pub(crate) fn allocate_vm_consts(&mut self) {
5        self.caller_vm_const_size_before_inline = self.caller.constants.len() as u32;
6        let reserve_size =
7            self.caller_vm_const_size_before_inline + self.target.constants.len() as u32;
8        self.caller.constants.reserve(reserve_size as usize);
9        for c in &self.target.constants {
10            self.caller.constants.push(c.clone());
11        }
12    }
13}