]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116984: Make mimalloc header includes relative to the current file (#118808)
authorSam Gross <colesbury@gmail.com>
Thu, 9 May 2024 20:03:45 +0000 (16:03 -0400)
committerGitHub <noreply@github.com>
Thu, 9 May 2024 20:03:45 +0000 (16:03 -0400)
Some embedders and extensions include parts of the internal API. The
pycore_mimalloc.h file is transitively include by a number of other
internal headers. This avoids include errors for code that was
already including those headers.

Include/internal/mimalloc/mimalloc/internal.h
Include/internal/mimalloc/mimalloc/types.h
Include/internal/pycore_mimalloc.h
Misc/NEWS.d/next/C API/2024-05-08-23-14-06.gh-issue-116984.5sgcDo.rst [new file with mode: 0644]

index 8af841cfdffc01840b8ddb61d7a907354578f018..94f88fb603af259b00d1ddd21e222ef6bec6450f 100644 (file)
@@ -14,8 +14,8 @@ terms of the MIT license. A copy of the license can be found in the file
 // functions and macros.
 // --------------------------------------------------------------------------
 
-#include "mimalloc/types.h"
-#include "mimalloc/track.h"
+#include "types.h"
+#include "track.h"
 
 #if (MI_DEBUG>0)
 #define mi_trace_message(...)  _mi_trace_message(__VA_ARGS__)
index 17e440848ecae5cbd38bd8efe170bd874bd981a7..354839ba955b3640422b7f94b229f9145ad621e7 100644 (file)
@@ -21,7 +21,7 @@ terms of the MIT license. A copy of the license can be found in the file
 
 #include <stddef.h>   // ptrdiff_t
 #include <stdint.h>   // uintptr_t, uint16_t, etc
-#include "mimalloc/atomic.h"  // _Atomic
+#include "atomic.h"   // _Atomic
 
 #ifdef _MSC_VER
 #pragma warning(disable:4214) // bitfield is not int
index 10d451398f14107e04c8940c8aef1190985fc496..100f78d53021eeae5099c4dfdd3669486fac1886 100644 (file)
@@ -36,9 +36,9 @@ typedef enum {
 #  define MI_TSAN 1
 #endif
 
-#include "mimalloc.h"
-#include "mimalloc/types.h"
-#include "mimalloc/internal.h"
+#include "mimalloc/mimalloc.h"
+#include "mimalloc/mimalloc/types.h"
+#include "mimalloc/mimalloc/internal.h"
 #endif
 
 #ifdef Py_GIL_DISABLED
diff --git a/Misc/NEWS.d/next/C API/2024-05-08-23-14-06.gh-issue-116984.5sgcDo.rst b/Misc/NEWS.d/next/C API/2024-05-08-23-14-06.gh-issue-116984.5sgcDo.rst
new file mode 100644 (file)
index 0000000..561417b
--- /dev/null
@@ -0,0 +1,3 @@
+Make mimalloc includes relative to the current file to avoid embedders or
+extensions needing to include ``Internal/mimalloc`` if they are already
+including internal CPython headers.