summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2023-12-12 00:04:48 (GMT)
committerGitHub <noreply@github.com>2023-12-12 00:04:48 (GMT)
commitfdee7b7b3e15931d58f07e5449de2e55b4d48b05 (patch)
treee04dca3c8005a42f1d5973938e6e41c64a6a6a26 /Include
parentfed294c6453527addd1644633849e2d8492058c5 (diff)
downloadcpython-fdee7b7b3e15931d58f07e5449de2e55b4d48b05.zip
cpython-fdee7b7b3e15931d58f07e5449de2e55b4d48b05.tar.gz
cpython-fdee7b7b3e15931d58f07e5449de2e55b4d48b05.tar.bz2
gh-112532: Require mimalloc in `--disable-gil` builds (gh-112883)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_pymem_init.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/Include/internal/pycore_pymem_init.h b/Include/internal/pycore_pymem_init.h
index 11fbe16..360fb92 100644
--- a/Include/internal/pycore_pymem_init.h
+++ b/Include/internal/pycore_pymem_init.h
@@ -18,7 +18,19 @@ extern void * _PyMem_RawRealloc(void *, void *, size_t);
extern void _PyMem_RawFree(void *, void *);
#define PYRAW_ALLOC {NULL, _PyMem_RawMalloc, _PyMem_RawCalloc, _PyMem_RawRealloc, _PyMem_RawFree}
-#if defined(WITH_PYMALLOC)
+#ifdef Py_GIL_DISABLED
+// Py_GIL_DISABLED requires mimalloc
+extern void* _PyObject_MiMalloc(void *, size_t);
+extern void* _PyObject_MiCalloc(void *, size_t, size_t);
+extern void _PyObject_MiFree(void *, void *);
+extern void* _PyObject_MiRealloc(void *, void *, size_t);
+# define PYOBJ_ALLOC {NULL, _PyObject_MiMalloc, _PyObject_MiCalloc, _PyObject_MiRealloc, _PyObject_MiFree}
+extern void* _PyMem_MiMalloc(void *, size_t);
+extern void* _PyMem_MiCalloc(void *, size_t, size_t);
+extern void _PyMem_MiFree(void *, void *);
+extern void* _PyMem_MiRealloc(void *, void *, size_t);
+# define PYMEM_ALLOC {NULL, _PyMem_MiMalloc, _PyMem_MiCalloc, _PyMem_MiRealloc, _PyMem_MiFree}
+#elif defined(WITH_PYMALLOC)
extern void* _PyObject_Malloc(void *, size_t);
extern void* _PyObject_Calloc(void *, size_t, size_t);
extern void _PyObject_Free(void *, void *);