diff --git a/Misc/NEWS.d/next/Library/2025-12-09-15-26-02.gh-issue-142490.-ov3D8.rst b/Misc/NEWS.d/next/Library/2025-12-09-15-26-02.gh-issue-142490.-ov3D8.rst new file mode 100644 index 00000000000000..d770c5812e7703 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-12-09-15-26-02.gh-issue-142490.-ov3D8.rst @@ -0,0 +1,2 @@ +It comes straight from the mach header as a global variable. No need to call +to get it. diff --git a/Modules/_ctypes/malloc_closure.c b/Modules/_ctypes/malloc_closure.c index 62c7aa5d6affbf..4b230bb8522072 100644 --- a/Modules/_ctypes/malloc_closure.c +++ b/Modules/_ctypes/malloc_closure.c @@ -12,6 +12,9 @@ # if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) # define MAP_ANONYMOUS MAP_ANON # endif +# if defined(__APPLE__) +# include +# endif #endif #include "ctypes.h" #include "pycore_mmap.h" // _PyAnnotateMemoryMap() @@ -55,7 +58,9 @@ static void more_core(void) } #else if (!_pagesize) { -#ifdef _SC_PAGESIZE +#ifdef __APPLE__ + _pagesize = vm_page_size; +#elif defined(_SC_PAGESIZE) _pagesize = sysconf(_SC_PAGESIZE); #else _pagesize = getpagesize();