mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
Allow overrides of MI_DEBUG memory constants
CPython and Windows CRT debug builds use different values for uninit, freed, and padding bytes. Make ``MI_DEBUG_*`` constants conditional to allow embedders to override the constants. Windows dbgheap: ``` _bNoMansLandFill = 0xFD _bDeadLandFill = 0xDD _bCleanLandFill = 0xCD ``` Python memory debug ``` PYMEM_CLEANBYTE 0xCD PYMEM_DEADBYTE 0xDD PYMEM_FORBIDDENBYTE 0xFD ``` Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
43e5cd2671
commit
0353fc38dd
1 changed files with 6 additions and 0 deletions
|
@ -393,9 +393,15 @@ struct mi_heap_s {
|
|||
// Debug
|
||||
// ------------------------------------------------------
|
||||
|
||||
#if !defined(MI_DEBUG_UNINIT)
|
||||
#define MI_DEBUG_UNINIT (0xD0)
|
||||
#endif
|
||||
#if !defined(MI_DEBUG_FREED)
|
||||
#define MI_DEBUG_FREED (0xDF)
|
||||
#endif
|
||||
#if !defined(MI_DEBUG_PADDING)
|
||||
#define MI_DEBUG_PADDING (0xDE)
|
||||
#endif
|
||||
|
||||
#if (MI_DEBUG)
|
||||
// use our own assertion to print without memory allocation
|
||||
|
|
Loading…
Add table
Reference in a new issue