Skip to content

gh-162214: Avoid undefined macros in mimalloc - #162226

Draft
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:wundef_mimalloc
Draft

vstinner wants to merge 1 commit into
python:mainfrom
vstinner:wundef_mimalloc

Conversation

@vstinner

@vstinner vstinner commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Replace "#if MACRO" with "#ifdef MACRO" to avoid compiler warnings when the MACRO is not defined and building Python with -Wundef.

Updated check on macros:

  • MI_HUGE_PAGE_ABANDON
  • MI_LARGE_PAGE_SIZE
  • MI_OSX_ZONE
  • MI_TLS_SLOT
  • MI_TRACK_ASAN
  • MI_TRACK_ETW
  • MI_TRACK_VALGRIND
  • MI_TSAN
  • _MSC_VER

Fix typo: MI_SEGMENT_SLIZE_SIZE => MI_SEGMENT_SLICE_SIZE (Z => S).

Replace "#if MACRO" with "#ifdef MACRO" to avoid compiler warnings
when the MACRO is not defined and building Python with -Wundef.

Updated check on macros:

* MI_HUGE_PAGE_ABANDON
* MI_LARGE_PAGE_SIZE
* MI_OSX_ZONE
* MI_TLS_SLOT
* MI_TRACK_ASAN
* MI_TRACK_ETW
* MI_TRACK_VALGRIND
* MI_TSAN
* _MSC_VER

Fix typo: MI_SEGMENT_SLIZE_SIZE => MI_SEGMENT_SLICE_SIZE (Z => S).
@vstinner

Copy link
Copy Markdown
Member Author

I created microsoft/mimalloc#1506 to track this issue in mimalloc upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant