diff options
author | Christian Heimes <christian@python.org> | 2022-01-05 13:11:44 +0100 |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2022-01-05 13:22:47 +0100 |
commit | 0353fc38dd575903a9a2d80c9ddfff245d3c579f (patch) | |
tree | 913137e6501afedaa1b8ece42d2e8febbf09634b /include/mimalloc-types.h | |
parent | 43e5cd2671585023d425f247b5c39cfa1207866a (diff) |
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>
Diffstat (limited to 'include/mimalloc-types.h')
-rw-r--r-- | include/mimalloc-types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mimalloc-types.h b/include/mimalloc-types.h index b349dfc..6eeffeb 100644 --- a/include/mimalloc-types.h +++ b/include/mimalloc-types.h @@ -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 |