cpython/Include/internal
Victor Stinner 9e23f0a27c
[3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) (GH-12788)
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)

Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.

Add unit tests on _PyObject_IsFreed().

(cherry picked from commit 2b00db6855)

* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)

Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().

(cherry picked from commit 4c409beb4c)
2019-04-11 22:30:31 +02:00
..
ceval.h
condvar.h
context.h bpo-32436: Implement PEP 567 (#5027) 2018-01-22 19:11:18 -05:00
gil.h
hamt.h Spelling fixes to docs, docstrings, and comments (GH-6374) 2018-04-20 14:00:41 -07:00
hash.h closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575) 2017-12-09 10:26:52 -08:00
import.h closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575) 2017-12-09 10:26:52 -08:00
mem.h [3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) (GH-12788) 2019-04-11 22:30:31 +02:00
pygetopt.h add 'extern' to pygetopt.h symbols, so then don't end up in comdat (#4909) 2017-12-17 10:34:00 -08:00
pystate.h bpo-36356: pymain_free() calls _PyRuntime_Finalize() (GH-12436) 2019-03-19 15:08:17 +01:00
warnings.h