[pypy-commit] pypy default: Don't register things manually with INTERPLEVEL_API, since they're never called as api.XXX
rlamy
pypy.commits at gmail.com
Wed Dec 14 12:44:24 EST 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch:
Changeset: r89062:faa5d87bf2a6
Date: 2016-12-14 17:43 +0000
http://bitbucket.org/pypy/pypy/changeset/faa5d87bf2a6/
Log: Don't register things manually with INTERPLEVEL_API, since they're
never called as api.XXX
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
@@ -7,7 +7,7 @@
from pypy.module.cpyext.api import (
cpython_api, bootstrap_function, PyObject, PyObjectP, ADDR,
CANNOT_FAIL, Py_TPFLAGS_HEAPTYPE, PyTypeObjectPtr, is_PyObject,
- INTERPLEVEL_API, PyVarObject)
+ PyVarObject)
from pypy.module.cpyext.state import State
from pypy.objspace.std.typeobject import W_TypeObject
from pypy.objspace.std.objectobject import W_ObjectObject
@@ -245,12 +245,10 @@
else:
return lltype.nullptr(PyObject.TO)
as_pyobj._always_inline_ = 'try'
-INTERPLEVEL_API['as_pyobj'] = as_pyobj
def pyobj_has_w_obj(pyobj):
w_obj = rawrefcount.to_obj(W_Root, pyobj)
return w_obj is not None and w_obj is not w_marker_deallocating
-INTERPLEVEL_API['pyobj_has_w_obj'] = staticmethod(pyobj_has_w_obj)
def is_pyobj(x):
@@ -260,7 +258,6 @@
return True
else:
raise TypeError(repr(type(x)))
-INTERPLEVEL_API['is_pyobj'] = staticmethod(is_pyobj)
class Entry(ExtRegistryEntry):
_about_ = is_pyobj
@@ -286,7 +283,6 @@
if not is_pyobj(obj):
keepalive_until_here(obj)
return pyobj
-INTERPLEVEL_API['make_ref'] = make_ref
@specialize.ll()
@@ -307,13 +303,11 @@
assert pyobj.c_ob_refcnt >= rawrefcount.REFCNT_FROM_PYPY
keepalive_until_here(w_obj)
return w_obj
-INTERPLEVEL_API['get_w_obj_and_decref'] = get_w_obj_and_decref
@specialize.ll()
def incref(space, obj):
make_ref(space, obj)
-INTERPLEVEL_API['incref'] = incref
@specialize.ll()
def decref(space, obj):
@@ -326,7 +320,6 @@
_Py_Dealloc(space, obj)
else:
get_w_obj_and_decref(space, obj)
-INTERPLEVEL_API['decref'] = decref
@cpython_api([PyObject], lltype.Void)
More information about the pypy-commit
mailing list