]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35368: Make PyMem_Malloc() thread-safe in debug mode (GH-10828)
authorVictor Stinner <vstinner@redhat.com>
Mon, 3 Dec 2018 11:29:29 +0000 (12:29 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Dec 2018 11:29:29 +0000 (12:29 +0100)
commitc275be54411d425c90e7c679ddb5321ba458f61d
treecb6180265d9b933064d9565c69b1f71659f80d1f
parentdfd4a1d8414ea54a3c56e909167983a503e51067
bpo-35368: Make PyMem_Malloc() thread-safe in debug mode (GH-10828)

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().
Misc/NEWS.d/next/Core and Builtins/2018-11-30-17-50-28.bpo-35368.DNaDao.rst [new file with mode: 0644]
Objects/obmalloc.c