Author: Armin Rigo <[email protected]>
Branch:
Changeset: r94564:0088ece5635b
Date: 2018-05-14 12:21 +0200
http://bitbucket.org/pypy/pypy/changeset/0088ece5635b/
Log: Make this a pointer instead of a Py_ssize_t. Why not, and reduces
the diff from reverse-debugger.
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
@@ -1164,8 +1164,8 @@
'_PyPy_tuple_dealloc', [PyObject], lltype.Void,
compilation_info=eci, _nowrapper=True)
_, state.C.set_marker = rffi.CExternVariable(
- Py_ssize_t, '_pypy_rawrefcount_w_marker_deallocating',
- eci, _nowrapper=True, c_type='Py_ssize_t')
+ rffi.VOIDP, '_pypy_rawrefcount_w_marker_deallocating',
+ eci, _nowrapper=True, c_type='void *')
state.C._PyPy_subtype_dealloc = rffi.llexternal(
'_PyPy_subtype_dealloc', [PyObject], lltype.Void,
compilation_info=eci, _nowrapper=True)
diff --git a/pypy/module/cpyext/include/object.h
b/pypy/module/cpyext/include/object.h
--- a/pypy/module/cpyext/include/object.h
+++ b/pypy/module/cpyext/include/object.h
@@ -49,7 +49,7 @@
PyAPI_FUNC(void) Py_IncRef(PyObject *);
PyAPI_FUNC(void) Py_DecRef(PyObject *);
-extern Py_ssize_t _pypy_rawrefcount_w_marker_deallocating;
+extern void *_pypy_rawrefcount_w_marker_deallocating;
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
#define Py_CLEAR(op) \
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
@@ -409,7 +409,7 @@
if we_are_translated():
llptr = cast_instance_to_base_ptr(w_marker_deallocating)
state = space.fromcache(State)
- state.C.set_marker(rffi.cast(Py_ssize_t, llptr))
+ state.C.set_marker(llptr)
@cpython_api([rffi.VOIDP], lltype.Signed, error=CANNOT_FAIL)
def _Py_HashPointer(space, ptr):
diff --git a/pypy/module/cpyext/src/object.c b/pypy/module/cpyext/src/object.c
--- a/pypy/module/cpyext/src/object.c
+++ b/pypy/module/cpyext/src/object.c
@@ -14,14 +14,14 @@
* tests we cannot call set_marker(), so we need to set a special value
* directly here)
*/
-Py_ssize_t _pypy_rawrefcount_w_marker_deallocating = 0xDEADFFF;
+void* _pypy_rawrefcount_w_marker_deallocating = (void*) 0xDEADFFF;
void
_Py_Dealloc(PyObject *obj)
{
PyTypeObject *pto = obj->ob_type;
/* this is the same as rawrefcount.mark_deallocating() */
- obj->ob_pypy_link = _pypy_rawrefcount_w_marker_deallocating;
+ obj->ob_pypy_link = (Py_ssize_t)_pypy_rawrefcount_w_marker_deallocating;
pto->tp_dealloc(obj);
}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit