A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-November/018378.html below:

Program very slow to finish

[Python-Dev] RE: Program very slow to finishNeil Schemenauer nas@python.ca
Tue, 6 Nov 2001 10:24:24 -0800
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 ?

PyMem_DEL should not be used since it could be using a different
allocator then PyObject_New.

> The reason I'm asking is that the mxDateTime objects I'm
> deallocating are actually unreferenced objects on a
> free list, so PyObject_Del() will probably bomb on them.

Why would it bomb?  It doesn't do anything special as far as I can tell
except free memory.  Vladimir went a bit overboard with the
pre-processor, IMHO, so its a little hard to tell for certain.

> Also, what should be done with failing constructors ? I usually
> use PyMem_DEL() to prevent the deallocator from being called but
> still free the allocated memory. Is that the correct approach ?

PyObject_Del() doesn't call the deallocator function.

  Neil



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