File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 14
14
#define MI_DEBUG_FREED PYMEM_DEADBYTE
15
15
#define MI_DEBUG_PADDING PYMEM_FORBIDDENBYTE
16
16
17
- /* ASAN builds don't use MI_DEBUG. ASAN + MI_DEBUG triggers additional
18
- * checks, which can cause mimalloc to print warnings to stderr. The
19
- * warnings break some tests.
17
+ /* ASAN builds don't use MI_DEBUG.
18
+ *
19
+ * ASAN + MI_DEBUG triggers additional checks, which can cause mimalloc
20
+ * to print warnings to stderr. The warnings break some tests.
20
21
*
21
22
* mi_usable_size: pointer might not point to a valid heap region:
22
23
* ...
30
31
# define MI_DEBUG 0
31
32
#endif
32
33
33
- /* Perform additional checks in debug builds, see mimalloc-types.h
34
+ #ifdef Py_DEBUG
35
+ /* Debug: Perform additional checks in debug builds, see mimalloc-types.h
34
36
* - enable basic and internal assertion checks with MI_DEBUG 2
35
37
* - check for double free, invalid pointer free
36
38
* - use guard pages to check for buffer overflows
37
39
*/
38
- #ifdef Py_DEBUG
39
40
# ifndef MI_DEBUG
40
41
# define MI_DEBUG 2
41
42
# endif
42
43
# define MI_SECURE 4
43
- #elif defined(PY_MIMALLOC_SECURE )
44
- # define MI_SECURE PY_MIMALLOC_SECURE
44
+ #else
45
+ // Production: no debug checks, secure depends on --enable-mimalloc-secure
46
+ # ifndef MI_DEBUG
47
+ # define MI_DEBUG 0
48
+ # endif
49
+ # if defined(PY_MIMALLOC_SECURE )
50
+ # define MI_SECURE PY_MIMALLOC_SECURE
51
+ # else
52
+ # define MI_SECURE 0
53
+ # endif
45
54
#endif
46
55
47
56
/* Prefix all non-static symbols with "_Py_"
You can’t perform that action at this time.
0 commit comments