Author: Stefan Beyer <h...@sbeyer.at> Branch: cpyext-gc-cycle Changeset: r95608:ada4b64c0816 Date: 2018-08-02 10:59 +0200 http://bitbucket.org/pypy/pypy/changeset/ada4b64c0816/
Log: Fixed cpyext test diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py --- a/pypy/module/cpyext/test/test_cpyext.py +++ b/pypy/module/cpyext/test/test_cpyext.py @@ -1069,6 +1069,7 @@ (initproc)Cycle_init, /* tp_init */ 0, /* tp_alloc */ Cycle_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ }; extern PyGC_Head *_pypy_rawrefcount_pyobj_list; @@ -1078,6 +1079,8 @@ Cycle *c = PyObject_GC_New(Cycle, &CycleType); if (c == NULL) return NULL; + + Py_INCREF(val); c->next = val; // TODO: check if _pypy_rawrefcount_pyobj_list contains c @@ -1100,7 +1103,3 @@ self.print_pyobj_list() c = module.create(Example(42)) self.print_pyobj_list() - - # TODO: fix rawrefcount, so that the Cycle objects are properly added - # to the ALLOCATED list of leakfinder or alternatively not freed - # by collect _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit