We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b4a605 commit 41e22eaCopy full SHA for 41e22ea
src/detection/memory/memory_obsd.c
@@ -2,10 +2,7 @@
2
#include "common/sysctl.h"
3
4
#include <sys/param.h>
5
-
6
-#if __NetBSD__
7
- #include <uvm/uvm_extern.h>
8
-#endif
+#include <uvm/uvm_extern.h>
9
10
const char* ffDetectMemory(FFMemoryResult* ram)
11
{
@@ -15,7 +12,7 @@ const char* ffDetectMemory(FFMemoryResult* ram)
15
12
return "sysctl(CTL_VM, VM_UVMEXP) failed";
16
13
17
14
ram->bytesTotal = (uint64_t) buf.npages * instance.state.platform.sysinfo.pageSize;
18
- ram->bytesUsed = ram->bytesTotal - (uint64_t) buf.free * instance.state.platform.sysinfo.pageSize;
+ ram->bytesUsed = ((uint64_t) buf.active + (uint64_t) buf.inactive + (uint64_t) buf.wired) * instance.state.platform.sysinfo.pageSize;
19
20
return NULL;
21
}
0 commit comments