[Patches] [ python-Patches-530556 ] Enable pymalloc

noreply@sourceforge.net noreply@sourceforge.net
Fri, 15 Mar 2002 16:54:42 -0800


Patches item #530556, was opened at 2002-03-16 01:01
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=530556&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Neil Schemenauer (nascheme)
Assigned to: Martin v. Löwis (loewis)
Summary: Enable pymalloc 

Initial Comment:
The attached patch removes the PyCore_* memory
management layer and gives up on the hope that
PyObject_DEL() will ever be anything but free().

pymalloc is given a visible API in the form of
PyMalloc_Malloc, PyMalloc_Realloc, PyMalloc_Free.  
A new object memory interface is implemented
on top of pymalloc in the form of
PyMalloc_{New,NewVar,Del}.  Those are ugly names.
Please suggest alternatives.

Some objects are changed to use pymalloc.  The
GC memory functions are changed to use pymalloc.

The configure support for enabling pymalloc was 
also removed.  Perhaps that should be left in so
people can disable pymalloc on low memory machines.

I left typeobject using the system allocator (new style
classes will not use pymalloc).  Fixing that is
probably a job for Guido. 


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-03-16 01:54

Message:
Logged In: YES 
user_id=21627

-1. --with-pymalloc should remain an option; there is still
the heuristics in releasing memory that may people make
uncomfortable. Also, on systems with super-efficient malloc,
you may not want to use pymalloc.

I dislike the name PyMalloc_Malloc; it may be acceptable for
the allocation algorithm itself (although it sounds funny).
However, for the PyObject allocator, something else needs to
be found.

I can't really see the problem with calling it
PyObject_New/_NewVar/_Del. None of these where available in
Python 1.5.2, so I don't think 1.5.2 code could break.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=530556&group_id=5470