Pasha Stetsenko wrote at 2020-10-23 11:32 -0700: > ... > static int my_init(PyObject*, PyObject*, PyObject*) { return 0; } > static void my_dealloc(PyObject*) {}
I think, the `dealloc` function is responsible to actually free the memory area. I see for example: static void Spec_dealloc(Spec* self) { /* PyType_GenericAlloc that you get when you don't specify a tp_alloc always tracks the object. */ PyObject_GC_UnTrack((PyObject *)self); if (self->weakreflist != NULL) { PyObject_ClearWeakRefs(OBJECT(self)); } Spec_clear(self); Py_TYPE(self)->tp_free(OBJECT(self)); } -- https://mail.python.org/mailman/listinfo/python-list