def malloc_big_fixedsize(size, tid): if self.DEBUG: self._random_usage_of_xmm_registers() type_id = llop.extract_ushort(llgroup.HALFWORD, tid) check_typeid(type_id) return llop1.do_malloc_fixedsize_clear(llmemory.GCREF, type_id, size, False, False, False)
def _bh_malloc(self, sizedescr): from rpython.memory.gctypelayout import check_typeid llop1 = self.llop1 type_id = llop.extract_ushort(llgroup.HALFWORD, sizedescr.tid) check_typeid(type_id) size = self.round_up_for_allocation(sizedescr.size) return llop1.do_malloc_fixedsize_clear(llmemory.GCREF, type_id, size, False, False, False)
def _bh_malloc(self, sizedescr): from rpython.memory.gctypelayout import check_typeid llop1 = self.llop1 type_id = llop.extract_ushort(llgroup.HALFWORD, sizedescr.tid) check_typeid(type_id) return llop1.do_malloc_fixedsize_clear(llmemory.GCREF, type_id, sizedescr.size, False, False, False)
def _bh_malloc_array(self, num_elem, arraydescr): from rpython.memory.gctypelayout import check_typeid llop1 = self.llop1 type_id = llop.extract_ushort(llgroup.HALFWORD, arraydescr.tid) check_typeid(type_id) return llop1.do_malloc_varsize_clear(llmemory.GCREF, type_id, num_elem, arraydescr.basesize, arraydescr.itemsize, arraydescr.lendescr.offset)
def malloc_array_nonstandard(basesize, itemsize, lengthofs, tid, num_elem): """For the rare case of non-standard arrays, i.e. arrays where self.standard_array_{basesize,length_ofs} is wrong. It can occur e.g. with arrays of floats on Win32.""" type_id = llop.extract_ushort(llgroup.HALFWORD, tid) check_typeid(type_id) return llop1.do_malloc_varsize_clear(llmemory.GCREF, type_id, num_elem, basesize, itemsize, lengthofs)
def malloc_array(itemsize, tid, num_elem): """Allocate an array with a variable-size num_elem. Only works for standard arrays.""" assert num_elem >= 0, 'num_elem should be >= 0' type_id = llop.extract_ushort(llgroup.HALFWORD, tid) check_typeid(type_id) return llop1.do_malloc_varsize_clear( llmemory.GCREF, type_id, num_elem, self.standard_array_basesize, itemsize, self.standard_array_length_ofs)
def malloc_array_nonstandard(basesize, itemsize, lengthofs, tid, num_elem): """For the rare case of non-standard arrays, i.e. arrays where self.standard_array_{basesize,length_ofs} is wrong. It can occur e.g. with arrays of floats on Win32.""" type_id = llop.extract_ushort(llgroup.HALFWORD, tid) check_typeid(type_id) return llop1.do_malloc_varsize_clear( llmemory.GCREF, type_id, num_elem, basesize, itemsize, lengthofs)