summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_mimalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_mimalloc.h')
-rw-r--r--Include/internal/pycore_mimalloc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Include/internal/pycore_mimalloc.h b/Include/internal/pycore_mimalloc.h
new file mode 100644
index 0000000..c29dc82
--- /dev/null
+++ b/Include/internal/pycore_mimalloc.h
@@ -0,0 +1,19 @@
+#ifndef Py_INTERNAL_MIMALLOC_H
+#define Py_INTERNAL_MIMALLOC_H
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
+#if defined(MIMALLOC_H) || defined(MIMALLOC_TYPES_H)
+# error "pycore_mimalloc.h must be included before mimalloc.h"
+#endif
+
+#include "pycore_pymem.h"
+#define MI_DEBUG_UNINIT PYMEM_CLEANBYTE
+#define MI_DEBUG_FREED PYMEM_DEADBYTE
+#define MI_DEBUG_PADDING PYMEM_FORBIDDENBYTE
+
+#include "mimalloc.h"
+
+#endif // Py_INTERNAL_MIMALLOC_H