[pypy-commit] pypy reflex-support: merge fix for memcpy into branch
wlav
noreply at buildbot.pypy.org
Fri Sep 20 08:36:32 CEST 2013
Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r67014:f19f98d0a00a
Date: 2013-09-16 11:33 -0700
http://bitbucket.org/pypy/pypy/changeset/f19f98d0a00a/
Log: merge fix for memcpy into branch
diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -1138,6 +1138,5 @@
c_memcpy = llexternal("memcpy",
[VOIDP, VOIDP, SIZE_T],
lltype.Void,
- _nowrapper=True, releasegil=False
+ releasegil=False
)
-
diff --git a/rpython/rtyper/lltypesystem/test/test_rffi.py b/rpython/rtyper/lltypesystem/test/test_rffi.py
--- a/rpython/rtyper/lltypesystem/test/test_rffi.py
+++ b/rpython/rtyper/lltypesystem/test/test_rffi.py
@@ -810,3 +810,12 @@
assert cast(LONG, x) == 65535
else:
assert cast(LONG, cast(INT, x)) == -1
+
+def test_c_memcpy():
+ p1 = str2charp("hello")
+ p2 = str2charp("WORLD")
+ c_memcpy(cast(VOIDP, p2), cast(VOIDP, p1), 3)
+ assert charp2str(p1) == "hello"
+ assert charp2str(p2) == "helLD"
+ free_charp(p1)
+ free_charp(p2)
More information about the pypy-commit
mailing list