Skip to content

Commit 503bda7

Browse files
committed
pythongh-116984: Make mimalloc header includes relative to the current file
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.
1 parent cb6f75a commit 503bda7

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Include/internal/mimalloc/mimalloc/internal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ terms of the MIT license. A copy of the license can be found in the file
1414
// functions and macros.
1515
// --------------------------------------------------------------------------
1616

17-
#include "mimalloc/types.h"
18-
#include "mimalloc/track.h"
17+
#include "types.h"
18+
#include "track.h"
1919

2020
#if (MI_DEBUG>0)
2121
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)

Include/internal/mimalloc/mimalloc/types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ terms of the MIT license. A copy of the license can be found in the file
2121

2222
#include <stddef.h> // ptrdiff_t
2323
#include <stdint.h> // uintptr_t, uint16_t, etc
24-
#include "mimalloc/atomic.h" // _Atomic
24+
#include "atomic.h" // _Atomic
2525

2626
#ifdef _MSC_VER
2727
#pragma warning(disable:4214) // bitfield is not int

Include/internal/pycore_mimalloc.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ typedef enum {
3636
# define MI_TSAN 1
3737
#endif
3838

39-
#include "mimalloc.h"
40-
#include "mimalloc/types.h"
41-
#include "mimalloc/internal.h"
39+
#include "mimalloc/mimalloc.h"
40+
#include "mimalloc/mimalloc/types.h"
41+
#include "mimalloc/mimalloc/internal.h"
4242
#endif
4343

4444
#ifdef Py_GIL_DISABLED
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Make mimalloc includes relative to the current file to avoid embedders or
2+
extensions needing to include ``Internal/mimalloc`` if they include
3+
``pycore_interp.h``.

0 commit comments

Comments
 (0)