Author: Armin Rigo <[email protected]>
Branch: cpyext-gc-support
Changeset: r80352:68f7ce2c461c
Date: 2015-10-20 12:08 +0200
http://bitbucket.org/pypy/pypy/changeset/68f7ce2c461c/

Log:    progress

diff --git a/pypy/module/cpyext/pyobject.py b/pypy/module/cpyext/pyobject.py
--- a/pypy/module/cpyext/pyobject.py
+++ b/pypy/module/cpyext/pyobject.py
@@ -232,11 +232,11 @@
     rawrefcount.create_link_pypy(w_obj, ob)
 
 def init_link_from_pyobj(w_obj, ob, is_transient):
+    ob.c_ob_refcnt += rawrefcount.REFCNT_FROM_PYPY
     if is_transient:
         rawrefcount.create_link_pyobj(w_obj, ob)
     else:
         rawrefcount.create_link_pypy(w_obj, ob)
-    ob.c_ob_refcnt += rawrefcount.REFCNT_FROM_PYPY
 
 def setup_prebuilt_pyobj(w_obj, py_obj):
     assert lltype.typeOf(py_obj) == PyObject
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -567,6 +567,8 @@
     pto = rffi.cast(PyTypeObjectPtr, py_obj)
     assert pto.c_tp_flags & Py_TPFLAGS_READYING
 
+    w_type.cpyext_c_type_object = pto
+
     w_bases = from_pyobj(space, pto.c_tp_bases)
     bases_w = space.fixedview(w_bases) or [space.w_object]
     name = rffi.charp2str(pto.c_tp_name)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to