diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-04-11 11:01:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 11:01:15 (GMT) |
commit | 4c409beb4c360a73d054f37807d3daad58d1b567 (patch) | |
tree | 03e835b35a2c910cd4793106eee2004212644746 /Objects/obmalloc.c | |
parent | 536a35b3f14888999f1ffa5be7239d0c26b73d7a (diff) | |
download | cpython-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/obmalloc.c')
-rw-r--r-- | Objects/obmalloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index e919fad..be43c7a 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1915,13 +1915,16 @@ _Py_GetAllocatedBlocks(void) /* Special bytes broadcast into debug memory blocks at appropriate times. * Strings of these are unlikely to be valid addresses, floats, ints or * 7-bit ASCII. If modified, _PyMem_IsPtrFreed() should be updated as well. + * + * Byte patterns 0xCB, 0xBB and 0xFB have been replaced with 0xCD, 0xDD and + * 0xFD to use the same values than Windows CRT debug malloc() and free(). */ #undef CLEANBYTE #undef DEADBYTE #undef FORBIDDENBYTE -#define CLEANBYTE 0xCB /* clean (newly allocated) memory */ -#define DEADBYTE 0xDB /* dead (newly freed) memory */ -#define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */ +#define CLEANBYTE 0xCD /* clean (newly allocated) memory */ +#define DEADBYTE 0xDD /* dead (newly freed) memory */ +#define FORBIDDENBYTE 0xFD /* untouchable bytes at each end of a block */ static size_t serialno = 0; /* incremented on each debug {m,re}alloc */ |