#include <os/proc.h> in the bridging header works on a test app I built.
In my project there is a lot of metal code. There is already a Bridging Header to facilitate that. (It defines a lot of C structures. Not my area of the code) When I add #include <os/proc.h> to that header the build fails withe error:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk/usr/include/sys/cdefs.h:825:2: Unsupported architecture
in cdefs.h
#if !defined(__sys_cdefs_arch_unknown__) && defined(__arm__)
#elif !defined(__sys_cdefs_arch_unknown__) && defined(__arm64__)
#else
#error Unsupported architecture
#endif
There are at least six os/proc.h files on my Mac picking one at random I see:
* If you need more information than just the available memory, you can use task_info().
* The information returned is equivalent to the task_vm_info.limit_bytes_remaining
* field. task_info() is a more expensive call, and will return information such
* as your phys_footprint, which is used to calculate the return of this function.
This seems to mean that I could substitute the code you supplied above which does some magic and returns task_vm_info_data_t.limit_bytes_remaining? You recommend against this but the value returned in a simple test is the same.