[issue26249] Change PyMem_Malloc to use pymalloc allocator

STINNER Victor report at bugs.python.org
Wed Mar 9 12:36:03 EST 2016


STINNER Victor added the comment:

2016-03-09 18:28 GMT+01:00 Antoine Pitrou <report at bugs.python.org>:
> Does the API doc say anything about the GIL, for example? Or Valgrind?

For the GIL, yes, Python 3 doc is explicit:
https://docs.python.org/dev/c-api/memory.html#memory-interface

Red and bold warning: "The GIL must be held when using these functions."

Hum, sadly it looks like the warning miss in Python 2 doc.

The GIL was the motivation to introduce the PyMem_RawMalloc() function
in Python 3.4.

For Valgrind: using the issue #26516, you will be able to use
PYTHONMALLOC=malloc to use easily Valgrind even on a Python compiled
in release mode (which is a new feature, before you had to manually
recompile Python in debug mode with --with-valgrind)).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26249>
_______________________________________


More information about the Python-bugs-list mailing list