summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-11 11:01:15 (GMT)
committerGitHub <noreply@github.com>2019-04-11 11:01:15 (GMT)
commit4c409beb4c360a73d054f37807d3daad58d1b567 (patch)
tree03e835b35a2c910cd4793106eee2004212644746 /Objects/object.c
parent536a35b3f14888999f1ffa5be7239d0c26b73d7a (diff)
downloadcpython-4c409beb4c360a73d054f37807d3daad58d1b567.zip
cpython-4c409beb4c360a73d054f37807d3daad58d1b567.tar.gz
cpython-4c409beb4c360a73d054f37807d3daad58d1b567.tar.bz2
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().
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/object.c b/Objects/object.c
index c9aa479..3fad73c 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -415,13 +415,12 @@ _Py_BreakPoint(void)
}
-/* Heuristic checking if the object memory has been deallocated.
- Rely on the debug hooks on Python memory allocators which fills the memory
- with DEADBYTE (0xDB) when memory is deallocated.
+/* Heuristic checking if the object memory is uninitialized or deallocated.
+ Rely on the debug hooks on Python memory allocators:
+ see _PyMem_IsPtrFreed().
The function can be used to prevent segmentation fault on dereferencing
- pointers like 0xdbdbdbdbdbdbdbdb. Such pointer is very unlikely to be mapped
- in memory. */
+ pointers like 0xDDDDDDDDDDDDDDDD. */
int
_PyObject_IsFreed(PyObject *op)
{