Author: Armin Rigo <[email protected]>
Branch: cpyext-gc-support-2
Changeset: r81957:0da7861a5b1a
Date: 2016-01-26 23:35 +0100
http://bitbucket.org/pypy/pypy/changeset/0da7861a5b1a/
Log: fixes, now getting a segfault
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -9,7 +9,7 @@
from rpython.rtyper.tool import rffi_platform
from rpython.rtyper.lltypesystem import ll2ctypes
from rpython.rtyper.annlowlevel import llhelper
-from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib.objectmodel import we_are_translated, keepalive_until_here
from rpython.translator import cdir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.gensupp import NameManager
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
@@ -11,7 +11,7 @@
from pypy.objspace.std.typeobject import W_TypeObject
from pypy.objspace.std.objectobject import W_ObjectObject
from rpython.rlib.objectmodel import specialize, we_are_translated
-from rpython.rlib.rweakref import RWeakKeyDictionary
+from rpython.rlib.objectmodel import keepalive_until_here
from rpython.rtyper.annlowlevel import llhelper
from rpython.rlib import rawrefcount
@@ -183,7 +183,7 @@
debug_refcount("MAKREF", py_obj, w_obj)
assert w_obj
assert py_obj
- rawrefcount.create_link_pypy(py_obj, w_obj)
+ rawrefcount.create_link_pypy(w_obj, py_obj)
def make_ref(space, w_obj):
"""
diff --git a/pypy/module/cpyext/test/test_api.py
b/pypy/module/cpyext/test/test_api.py
--- a/pypy/module/cpyext/test/test_api.py
+++ b/pypy/module/cpyext/test/test_api.py
@@ -6,6 +6,7 @@
from pypy.module.cpyext.test.test_cpyext import freeze_refcnts,
LeakCheckingTest
PyObject = api.PyObject
from pypy.interpreter.error import OperationError
+from rpython.rlib import rawrefcount
import os
@api.cpython_api([PyObject], lltype.Void)
@@ -36,6 +37,9 @@
cls.api = CAPI()
CAPI.__dict__.update(api.INTERPLEVEL_API)
+ print 'DONT_FREE_ANY_MORE'
+ rawrefcount._dont_free_any_more()
+
def raises(self, space, api, expected_exc, f, *args):
if not callable(f):
raise Exception("%s is not callable" % (f,))
@@ -49,6 +53,7 @@
return state.clear_exception()
def setup_method(self, func):
+ #return # ZZZ
freeze_refcnts(self)
def teardown_method(self, func):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit