• Victor Stinner's avatar
    bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) · 2b00db68
    Victor Stinner authored
    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().
    2b00db68
obmalloc.c 83 KB