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/2002-January/019711.html below:

[Python-Dev] Mixing memory management APIs

[Python-Dev] Mixing memory management APIsM.-A. Lemburg mal@lemburg.com
Wed, 30 Jan 2002 20:15:33 +0100
Neil Schemenauer wrote:
> 
> Michael Hudson wrote:
> > I agree we have too many preprocessor macros, but I don't think we can
> > have free == PyObject_DEL.
> 
> If we don't then many extension modules will break.  The example module
> Modules/xxmodule.c used to allocate using PyObject_New and deallocate
> using free().  I believe there are many modules out there that do the
> same (or use PyMem_Del, etc).

Breaking extensions is not a good idea. After all, these make
Python so much fun to work with (since most of the work is usually
already done ;-).

I do think that we should keep the differentiation between
allocating raw memory buffers and space for Python objects.

Even though this is not currently used, it clarifies the
code somewhat, e.g. to free memory allocated for a Python
object you write PyObject_FREE(), for an raw buffer you
write PyMem_FREE(). 

Who knows... perhaps we might want to
handle Python object memory blocks differently in the
future (e.g. build pymalloc support right into 
PyObject_NEW() and PyObject_DEL()) while leaving user space
memory in the realm of malloc() et al.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/



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