X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/a38dee0c58dae0d276ab663eddf7124c2ce9acc5..ef72d5f07dbddb7d236637465aecee328748964e:/ITVirtualMemoryInfo.m diff --git a/ITVirtualMemoryInfo.m b/ITVirtualMemoryInfo.m index 4017993..6d8e004 100755 --- a/ITVirtualMemoryInfo.m +++ b/ITVirtualMemoryInfo.m @@ -1,7 +1,8 @@ #import "ITVirtualMemoryInfo.h" +#import @interface ITVirtualMemoryInfo (Private) -- (BOOL)refreshStats; +- (BOOL)refreshStats:(struct vm_statistics *)myStat; @end @implementation ITVirtualMemoryInfo @@ -18,14 +19,7 @@ - (int)pageSize { - int pageSize = 0; - - if ( host_page_size(mach_host_self(), &pageSize) != KERN_SUCCESS ) { - NSLog(@"Failed to get page size, defaulting to 4096/4k"); - pageSize = DEFAULT_PAGE_SIZE; - } - - return pageSize; + return getpagesize(); } - (int)freePages @@ -112,7 +106,7 @@ - (BOOL)refreshStats:(struct vm_statistics *)myStat { - bzero(&myStat,sizeof(myStat)); + bzero(myStat,sizeof(myStat)); mach_port_t myHost = mach_host_self(); int count = HOST_VM_INFO_COUNT; NSLog(@"%i",count);