8000 gh-116984: Make mimalloc header includes relative to the current file… · python/cpython@71cc065 · GitHub
[go: up one dir, main page]

Skip to content

Commit 71cc065

Browse files
authored
gh-116984: Make mimalloc header includes relative to the current file (#118808)
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 2402715 commit 71cc065

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Include/internal/mimalloc/mimalloc/internal.h

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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
Lines changed: 3 additions & 0 deletions
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 are already
3+
including internal CPython headers.

0 commit comments

Comments
 (0)
0