[Guido]
> Shouldn't it at least match call_readline() in Modules/readline.c,
> which uses PyMem_Malloc()?

I'm not sure what "it" means there, but, like I said, it's messy
regardless.  That's why we ended up with a large number of mismatches
to begin with:  there are many allocation and free'ing sites, spread
over several modules, and these don't follow nice patterns. 
call_readline() is just one of the ways the memory might be allocated
to begin with, and they can all end up on the same lines of code that
try to free memory.

> Also, since it's really a char array, I don't see the point of using something
> with "Object" in its name.

The PyObject_ memory family is generally faster and more
memory-efficient for small allocations than the PyMem_ memory family. 
Lines of source code, and encoding strings, are usually small enough
to exploit that.  The "ob" in obmalloc.c doesn't really have anything
to do with objects either.  PyMem_SmallMalloc (etc) may have been
better names (although I doubt that ;-)).
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to