From 66389719939f85efd3050f62eae8fb03ddf0d101 Mon Sep 17 00:00:00 2001 From: WHR Date: Tue, 7 Jan 2025 10:50:18 +0000 Subject: [PATCH] Refactor variables 'memWire' and 'memActive' out from 'FreeBSDMachine' object They are used only temporarily in function 'FreeBSDMachine_scanMemoryInfo'. --- freebsd/FreeBSDMachine.c | 4 +--- freebsd/FreeBSDMachine.h | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/freebsd/FreeBSDMachine.c b/freebsd/FreeBSDMachine.c index d781414b4..3a478679e 100644 --- a/freebsd/FreeBSDMachine.c +++ b/freebsd/FreeBSDMachine.c @@ -340,12 +340,10 @@ static void FreeBSDMachine_scanMemoryInfo(Machine* super) { len = sizeof(memActive); sysctl(MIB_vm_stats_vm_v_active_count, 4, &(memActive), &len, NULL, 0); memActive *= this->pageSizeKb; - this->memActive = memActive; len = sizeof(memWire); sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(memWire), &len, NULL, 0); memWire *= this->pageSizeKb; - this->memWire = memWire; len = sizeof(buffersMem); sysctl(MIB_vfs_bufspace, 2, &(buffersMem), &len, NULL, 0); @@ -361,7 +359,7 @@ static void FreeBSDMachine_scanMemoryInfo(Machine* super) { sysctl(MIB_vm_vmtotal, 2, &(vmtotal), &len, NULL, 0); super->sharedMem = vmtotal.t_rmshr * this->pageSizeKb; - super->usedMem = this->memActive + this->memWire; + super->usedMem = memActive + memWire; struct kvm_swap swap[16]; int nswap = kvm_getswapinfo(this->kd, swap, ARRAYSIZE(swap), 0); diff --git a/freebsd/FreeBSDMachine.h b/freebsd/FreeBSDMachine.h index f34b568e6..0f9c33f26 100644 --- a/freebsd/FreeBSDMachine.h +++ b/freebsd/FreeBSDMachine.h @@ -36,9 +36,6 @@ typedef struct FreeBSDMachine_ { int pageSizeKb; int kernelFScale; - unsigned long long int memWire; - unsigned long long int memActive; - ZfsArcStats zfs; CPUData* cpus;