mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)
Fix _PyBytesWriter API when Python is built in release mode with assertions.
This commit is contained in:
parent
6876257eaa
commit
60ec6efd96
3 changed files with 48 additions and 47 deletions
|
@ -154,6 +154,21 @@ PyAPI_FUNC(int) _PyMem_SetDefaultAllocator(
|
|||
PyMemAllocatorDomain domain,
|
||||
PyMemAllocatorEx *old_alloc);
|
||||
|
||||
/* 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.
|
||||
|
||||
- PYMEM_CLEANBYTE: clean (newly allocated) memory
|
||||
- PYMEM_DEADBYTE dead (newly freed) memory
|
||||
- PYMEM_FORBIDDENBYTE: untouchable bytes at each end of a block
|
||||
|
||||
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().
|
||||
If modified, _PyMem_IsPtrFreed() should be updated as well. */
|
||||
#define PYMEM_CLEANBYTE 0xCD
|
||||
#define PYMEM_DEADBYTE 0xDD
|
||||
#define PYMEM_FORBIDDENBYTE 0xFD
|
||||
|
||||
/* Heuristic checking if a pointer value is newly allocated
|
||||
(uninitialized), newly freed or NULL (is equal to zero).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue