diff --git a/src/detection/memory/memory_apple.c b/src/detection/memory/memory_apple.c index cabdab267d..190ff98d5a 100644 --- a/src/detection/memory/memory_apple.c +++ b/src/detection/memory/memory_apple.c @@ -16,15 +16,12 @@ const char* ffDetectMemory(FFMemoryResult* ram) if(host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info64_t) (&vmstat), &count) != KERN_SUCCESS) return "Failed to read host_statistics64"; - // https://github.com/exelban/stats/blob/master/Modules/RAM/readers.swift#L56 + // https://github.com/apple-opensource/top/blob/e7979606cf63270663a62cfe69f82d35cef9ba58/globalstats.c#L433-L435 ram->bytesUsed = ((uint64_t) - + vmstat.active_count - + vmstat.inactive_count - + vmstat.speculative_count - + vmstat.wire_count + + vmstat.wire_count + + vmstat.inactive_count + + vmstat.active_count + vmstat.compressor_page_count - - vmstat.purgeable_count - - vmstat.external_page_count ) * instance.state.platform.sysinfo.pageSize; return NULL;