def _do_getslice(self, w_slice): ctptr, start, length = self._do_getslicearg(w_slice) # space = self.space ctarray = ctptr.cache_array_type if ctarray is None: from pypy.module._cffi_backend import newtype ctarray = newtype.new_array_type(space, ctptr, space.w_None) ctptr.cache_array_type = ctarray # p = rffi.ptradd(self._cdata, start * ctarray.ctitem.size) return W_CDataSliced(space, p, ctarray, length)
def _do_getslice(self, w_slice): ctptr, start, length = self._do_getslicearg(w_slice) # space = self.space ctarray = ctptr.cache_array_type if ctarray is None: from pypy.module._cffi_backend import newtype ctarray = newtype.new_array_type(space, ctptr, space.w_None) ctptr.cache_array_type = ctarray # p = rffi.ptradd(self._cdata, start * ctarray.ctitem.size) return W_CDataSliced(space, p, ctarray, length)