Skip to content

Commit

Permalink
Refactor variables 'memWire' and 'memActive' out from 'FreeBSDMachine…
Browse files Browse the repository at this point in the history
…' object

They are used only temporarily in function 'FreeBSDMachine_scanMemoryInfo'.
  • Loading branch information
Low-power authored and BenBE committed Jan 7, 2025
1 parent 8990cc5 commit 6638971
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions freebsd/FreeBSDMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions freebsd/FreeBSDMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6638971

Please sign in to comment.