Closed freakboy3742 closed 1 month ago
Thanks for finding this -- I used your suggested fix and documented why we include mach/vm_statistics.h
(a header file from 1991 :-) ). We need it mostly for large OS pages and tagging mimalloc memory but it is not essential so can be left out if the OS variant does not support that.
The file
src/prim/unix/prim.c
references 2 preprocessor symbolsTARGET_IOS_IPHONE
andTARGET_IOS_SIMULATOR
.These symbols don't exist in the macOS 14 or iOS 17 SDKs. I suspect they should be
TARGET_OS_IPHONE
andTARGET_OS_SIMULATOR
.Alternatively, if the intention is to only include the header on macOS,
#if !defined(TARGET_OS_OSX) || TARGET_OS_OSX
would allow an explicit check that the platform is macOS (rather than "not not iPhone"), allowing for older macOS SDKs that predate the introduction ofTARGET_OS_OSX
.That said, it's also not clear to me that the branch is needed at all, as
mach/vm_statistics.h
exists in the iOS 17 SDK. However, I'm not sufficiently familiar with what the code is doing in this case to comment. I'm not sure if this wasn't the case on older iOS SDKs.