[pypy-svn] r47190 - pypy/branch/kill-keepalives-again/pypy/rpython/rctypes

arigo at codespeak.net arigo at codespeak.net
Fri Oct 5 15:31:50 CEST 2007


Author: arigo
Date: Fri Oct  5 15:31:49 2007
New Revision: 47190

Modified:
   pypy/branch/kill-keepalives-again/pypy/rpython/rctypes/rmodel.py
Log:
Fix reccopy(), which is used by llmemory.raw_memcopy()
(it should really be moved to llmemory).


Modified: pypy/branch/kill-keepalives-again/pypy/rpython/rctypes/rmodel.py
==============================================================================
--- pypy/branch/kill-keepalives-again/pypy/rpython/rctypes/rmodel.py	(original)
+++ pypy/branch/kill-keepalives-again/pypy/rpython/rctypes/rmodel.py	Fri Oct  5 15:31:49 2007
@@ -272,8 +272,8 @@
         ITEMTYPE = T.OF
         for i in range(source._obj.getlength()):
             if isinstance(ITEMTYPE, lltype.ContainerType):
-                subsrc = source[i]
-                subdst = dest[i]
+                subsrc = source._obj._getitem(i)._as_ptr()
+                subdst = dest._obj._getitem(i)._as_ptr()
                 reccopy(subsrc, subdst)
             else:
                 # this is a hack XXX de-hack this
@@ -283,8 +283,8 @@
         for name in T._names:
             FIELDTYPE = getattr(T, name)
             if isinstance(FIELDTYPE, lltype.ContainerType):
-                subsrc = getattr(source, name)
-                subdst = getattr(dest,   name)
+                subsrc = source._obj._getattr(name)._as_ptr()
+                subdst = dest._obj._getattr(name)._as_ptr()
                 reccopy(subsrc, subdst)
             else:
                 # this is a hack XXX de-hack this



More information about the Pypy-commit mailing list