Download this file
16 lines (13 with data), 406 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | /* fre() function */
#include "../fb.h"
#include <mach/host_info.h>
#include <mach/mach_host.h>
#include <unistd.h>
FBCALL size_t fb_GetMemAvail( int mode )
{
vm_statistics_data_t vmstat;
mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
if( host_statistics( mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &count) != KERN_SUCCESS )
return 0;
return vmstat.free_count * getpagesize();
}
|
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.