STINNER Victor added the comment:

When I wrote the PEP 445, I already proposed to add a new environment variable 
to install debug hooks on a Python compiled in release mode:

https://www.python.org/dev/peps/pep-0445/#add-a-new-pydebugmalloc-environment-variable

But the proposition was rejected because of the PEP 432, but 3 years later, 
this PEP is still stuck at the draft state. So I propose to move on.

Anyway, PYTHONMALLOC is really a corner case since it must be read *very early* 
(first instruction of main()).


Oh by the way, I forgot to explain the initial motivation for this change! It's 
the issue #26249: "Change PyMem_Malloc to use pymalloc allocator". With this 
change, applications misuing PyMem_Malloc API (ex: alloc memory with 
PyMem_Malloc(), free memory with free()) will start to crash. 
PYTHONMALLOC=debug should help these applications to detect bugs easier and get 
an obvious error message.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26516>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to