Author: Alex Gaynor <alex.gay...@gmail.com> Branch: Changeset: r45411:5d2970523f79 Date: 2011-07-07 14:28 -0700 http://bitbucket.org/pypy/pypy/changeset/5d2970523f79/
Log: switch from using rffi to call memcpy form C to using rgc.ll_arraycopy (which works for non-gc arrays apparently) diff --git a/pypy/module/array/interp_array.py b/pypy/module/array/interp_array.py --- a/pypy/module/array/interp_array.py +++ b/pypy/module/array/interp_array.py @@ -11,12 +11,11 @@ from pypy.objspace.std.stdtypedef import SMM, StdTypeDef from pypy.objspace.std.register_all import register_all from pypy.rlib.rarithmetic import ovfcheck +from pypy.rlib.rgc import ll_arraycopy from pypy.rlib.unroll import unrolling_iterable from pypy.rpython.lltypesystem import lltype, rffi -memcpy = rffi.llexternal("memcpy", [rffi.VOIDP, rffi.VOIDP, rffi.SIZE_T], lltype.Void) - @unwrap_spec(typecode=str) def w_array(space, w_cls, typecode, __args__): if len(__args__.arguments_w) > 1: @@ -621,10 +620,12 @@ def array_copy__Array(space, self): w_a = mytype.w_class(self.space) w_a.setlen(self.len) - memcpy( - rffi.cast(rffi.VOIDP, w_a.buffer), - rffi.cast(rffi.VOIDP, self.buffer), - self.len * mytype.bytes + ll_arraycopy( + self.buffer, + w_a.buffer, + 0, + 0, + self.len, ) return w_a _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit