Skip to content

Commit edebf89

Browse files
committed
Remove unused PyTruffle_ADDREF
1 parent 25162be commit edebf89

File tree

2 files changed

+0
-21
lines changed
  • graalpython
    • com.oracle.graal.python.cext/src
    • com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi

2 files changed

+0
-21
lines changed

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -425,26 +425,6 @@ PyAPI_FUNC(void) PyTruffle_DECREF(PyObject* obj) {
425425
Py_DECREF(obj);
426426
}
427427

428-
/** to be used from Java code only; calls ADDREF */
429-
PyAPI_FUNC(Py_ssize_t) PyTruffle_ADDREF(intptr_t ptr, Py_ssize_t value) {
430-
PyObject* obj = (PyObject*) ptr; // avoid type attachment at the interop boundary
431-
#ifdef ASSERTIONS
432-
if (obj->ob_refcnt & 0xFFFFFFFF00000000L) {
433-
char buf[1024];
434-
sprintf(buf, "suspicious refcnt value during managed adjustment for %p (%zd 0x%zx + %zd)\n", obj, obj->ob_refcnt, obj->ob_refcnt, value);
435-
Py_FatalError(buf);
436-
}
437-
if ((obj->ob_refcnt + value) <= 0) {
438-
char buf[1024];
439-
sprintf(buf, "refcnt reached zero during managed adjustment for %p (%zd 0x%zx + %zd)\n", obj, obj->ob_refcnt, obj->ob_refcnt, value);
440-
Py_FatalError(buf);
441-
}
442-
// printf("refcnt value during managed adjustment for %p (%zd 0x%zx + %zd)\n", obj, obj->ob_refcnt, obj->ob_refcnt, value);
443-
#endif // ASSERTIONS
444-
445-
return (obj->ob_refcnt += value);
446-
}
447-
448428
/** to be used from Java code only; calls DECREF */
449429
PyAPI_FUNC(Py_ssize_t) PyTruffle_SUBREF(intptr_t ptr, Py_ssize_t value) {
450430
PyObject* obj = (PyObject*) ptr; // avoid type attachment at the interop boundary

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/NativeCAPISymbol.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ public enum NativeCAPISymbol implements NativeCExtSymbol {
136136
FUN_PYMEM_ALLOC("PyMem_Calloc", Pointer, SIZE_T, SIZE_T),
137137
FUN_INCREF("Py_IncRef", Void, Pointer),
138138
FUN_DECREF("Py_DecRef", Void, Pointer),
139-
FUN_ADDREF("PyTruffle_ADDREF", Py_ssize_t, Pointer, Py_ssize_t),
140139
FUN_SUBREF("PyTruffle_SUBREF", Py_ssize_t, Pointer, Py_ssize_t),
141140
FUN_BULK_DEALLOC("PyTruffle_bulk_DEALLOC", Py_ssize_t, Pointer, INT64_T),
142141
FUN_SHUTDOWN_BULK_DEALLOC("PyTruffle_shutdown_bulk_DEALLOC", Py_ssize_t, Pointer, INT64_T),

0 commit comments

Comments
 (0)