mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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().
This commit is contained in:
parent
536a35b3f1
commit
4c409beb4c
6 changed files with 37 additions and 24 deletions
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue