Skip to content

Commit dcb02e9

Browse files
committed
Add tp_dealloc and tp_free
1 parent 7ae3476 commit dcb02e9

File tree

2 files changed

+2
-2
lines changed
  • graalpython

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ extern size_t PyTruffle_NativeMemoryGCBarrier;
800800
#undef bool // may be defined as "_Bool"
801801
// alphabetical, but base types first
802802
#define PY_TYPE_OBJECTS \
803-
PY_TRUFFLE_TYPE_GENERIC(PyType_Type, type, &PyType_Type, sizeof(PyHeapTypeObject), sizeof(PyMemberDef), PyType_GenericAlloc, 0, 0, 0) \
803+
PY_TRUFFLE_TYPE_GENERIC(PyType_Type, type, &PyType_Type, sizeof(PyHeapTypeObject), sizeof(PyMemberDef), PyType_GenericAlloc, object_dealloc, PyObject_GC_Del, 0) \
804804
PY_TRUFFLE_TYPE_WITH_ALLOC(PyBaseObject_Type, object, &PyType_Type, sizeof(PyObject), PyType_GenericAlloc, object_dealloc, PyObject_Del) \
805805
PY_TRUFFLE_TYPE(PyCFunction_Type, builtin_function_or_method, &PyType_Type, sizeof(PyCFunctionObject)) \
806806
PY_TRUFFLE_TYPE(_PyBytesIOBuffer_Type, _BytesIOBuffer, &PyType_Type, 0) \

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def test_tp_alloc(self):
591591
TestTpAlloc = CPyExtType("TestTpAlloc",
592592
'''
593593
static PyObject* testslots_tp_alloc(PyObject* self) {
594-
return Py_XNewRef(PyType_Type.tp_alloc(&PyType_Type, 0));
594+
return (PyObject*) PyType_Type.tp_alloc(&PyType_Type, 0);
595595
}
596596
''',
597597
tp_methods='{"get_tp_alloc", (PyCFunction)testslots_tp_alloc, METH_NOARGS, ""}',

0 commit comments

Comments
 (0)