Author: Armin Rigo <[email protected]>
Branch: cpyext-gc-support-2
Changeset: r82291:dfaf329934e4
Date: 2016-02-16 18:25 +0100
http://bitbucket.org/pypy/pypy/changeset/dfaf329934e4/

Log:    Finally, remove the GOES_AWAY stubs left behind

diff --git a/pypy/module/cpyext/dictobject.py b/pypy/module/cpyext/dictobject.py
--- a/pypy/module/cpyext/dictobject.py
+++ b/pypy/module/cpyext/dictobject.py
@@ -3,7 +3,6 @@
     cpython_api, CANNOT_FAIL, build_type_checkers, Py_ssize_t,
     Py_ssize_tP, CONST_STRING)
 from pypy.module.cpyext.pyobject import PyObject, PyObjectP, as_pyobj
-from pypy.module.cpyext.pyobject import RefcountState
 from pypy.module.cpyext.pyerrors import PyErr_BadInternalCall
 from pypy.interpreter.error import OperationError
 from rpython.rlib.objectmodel import specialize
diff --git a/pypy/module/cpyext/intobject.py b/pypy/module/cpyext/intobject.py
--- a/pypy/module/cpyext/intobject.py
+++ b/pypy/module/cpyext/intobject.py
@@ -5,7 +5,7 @@
     cpython_api, cpython_struct, build_type_checkers, bootstrap_function,
     PyObject, PyObjectFields, CONST_STRING, CANNOT_FAIL, Py_ssize_t)
 from pypy.module.cpyext.pyobject import (
-    make_typedescr, track_reference, RefcountState, from_ref)
+    make_typedescr, track_reference, from_ref)
 from rpython.rlib.rarithmetic import r_uint, intmask, LONG_TEST, r_ulonglong
 from pypy.objspace.std.intobject import W_IntObject
 import sys
@@ -38,8 +38,6 @@
     w_obj = space.allocate_instance(W_IntObject, w_type)
     w_obj.__init__(intval)
     track_reference(space, obj, w_obj)
-    #state = space.fromcache(RefcountState)
-    #state.set_lifeline(w_obj, obj)
     return w_obj
 
 PyInt_Check, PyInt_CheckExact = build_type_checkers("Int")
diff --git a/pypy/module/cpyext/object.py b/pypy/module/cpyext/object.py
--- a/pypy/module/cpyext/object.py
+++ b/pypy/module/cpyext/object.py
@@ -6,7 +6,7 @@
     Py_GE, CONST_STRING, FILEP, fwrite)
 from pypy.module.cpyext.pyobject import (
     PyObject, PyObjectP, create_ref, from_ref, Py_IncRef, Py_DecRef,
-    get_typedescr, _Py_NewReference, RefcountState)
+    get_typedescr, _Py_NewReference)
 from pypy.module.cpyext.typeobject import PyTypeObjectPtr
 from pypy.module.cpyext.pyerrors import PyErr_NoMemory, PyErr_BadInternalCall
 from pypy.objspace.std.typeobject import W_TypeObject
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
@@ -63,9 +63,6 @@
         w_type = from_ref(space, rffi.cast(PyObject, obj.c_ob_type))
         w_obj = space.allocate_instance(self.W_BaseObject, w_type)
         track_reference(space, obj, w_obj)
-        #if w_type is not space.gettypefor(self.W_BaseObject):
-        #    state = space.fromcache(RefcountState)
-        #    state.set_lifeline(w_obj, obj)
         return w_obj
 
 typedescr_cache = {}
@@ -160,14 +157,7 @@
     Allocates a PyObject, and fills its fields with info from the given
     interpreter object.
     """
-    #state = space.fromcache(RefcountState)
     w_type = space.type(w_obj)
-    #if w_type.is_cpytype():
-    #    py_obj = state.get_from_lifeline(w_obj)
-    #    if py_obj:
-    #        Py_IncRef(space, py_obj)
-    #        return py_obj
-
     typedescr = get_typedescr(w_obj.typedef)
     py_obj = typedescr.allocate(space, w_type, itemcount=itemcount)
     track_reference(space, py_obj, w_obj)
@@ -350,11 +340,3 @@
 @cpython_api([rffi.VOIDP], lltype.Signed, error=CANNOT_FAIL)
 def _Py_HashPointer(space, ptr):
     return rffi.cast(lltype.Signed, ptr)
-
-
-class RefcountState:
-    def __init__(self, *args):
-        GOES_AWAY
-
-def borrow_from(container, borrowed):
-    GOES_AWAY
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
@@ -21,7 +21,7 @@
 from pypy.module.cpyext.modsupport import convert_method_defs
 from pypy.module.cpyext.pyobject import (
     PyObject, make_ref, create_ref, from_ref, get_typedescr, make_typedescr,
-    track_reference, RefcountState, Py_DecRef, as_pyobj)
+    track_reference, Py_DecRef, as_pyobj)
 from pypy.module.cpyext.slotdefs import (
     slotdefs_for_tp_slots, slotdefs_for_wrappers, get_slot_tp_function)
 from pypy.module.cpyext.state import State
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to