◐ Shell
clean mode source ↗

[2.7] bpo-35368: Make PyMem_Malloc() thread-safe in debug mode by vstinner · Pull Request #10828 · python/cpython

When Python is compiled in debug mode, PyMem_Malloc() uses debug
hooks, but it also uses pymalloc allocator instead of malloc().
Problem: pymalloc is not thread-safe, whereas PyMem_Malloc() is
thread-safe in release mode (it's a thin wrapper to malloc() in this
case).

Modify the debug hook to use malloc() for PyMem_Malloc().

@vstinner vstinner changed the title [2.7] bpo-33015: Make PyMem_Malloc() thread-safe in debug mode [2.7] bpo-35368: Make PyMem_Malloc() thread-safe in debug mode

Nov 30, 2018

benjaminp