[M.-A. Lemburg wrote:] > What is considered the "right" approach for this ? Should Python > objects *always* be deallocated using one of PyObject_Del() and > PyObject_DEL() or is PyMem_DEL() usable as well ? I agree with everything Neil said. Note that the xxx_del/DEL functions are not destructors, nor do they call destructors. Despite their arguably odd names, they don't even care whether you pass a pointer to a Python object. Without pymalloc enabled, chase down the layers of macros and all any of them do is call free(), although PyMem_DEL -> PyMem_FREE -> PyCore_FREE -> PyCore_FREE_FUNC and there's *some* scheme or other hiding in here that's supposed to let users define their own expansion for at least one of the steps in that chain. It's complicated, and I'm not sure anyone understands all the design details anymore.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4