Vanilla-Conquer icon indicating copy to clipboard operation
Vanilla-Conquer copied to clipboard

Free ram

Open giulianobelinassi opened this issue 2 years ago • 2 comments

Implement Free_Ram to check how much RAM we have left.

giulianobelinassi avatar Jul 02 '22 03:07 giulianobelinassi

This thing is broken. Please don't review it until I say it is fixed.

giulianobelinassi avatar Jul 02 '22 04:07 giulianobelinassi

Just a comment that you might want to look at using the sysctl function for checking the memory as it is available on macOS, *BSD and Linux. Also, I think macOS defines the unix macros which might be tripping you up?

The reason why macOS fails is because in some docs from apple it said that I must include proc.h and then call os_proc_available_memory to get the amount of available memory. But the compiler can't find it on the CI.

What is broken there is the bsearch'ing for the maximum allocable memory size on the case that no known platform is found.

giulianobelinassi avatar Jul 04 '22 15:07 giulianobelinassi