mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Fix build on macos
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
static void detectRam(FFMemoryStorage* ram)
|
||||
{
|
||||
memory->ram.bytesTotal = (uint64_t) ffSysctlGetInt64("hw.memsize", 0);
|
||||
ram->bytesTotal = (uint64_t) ffSysctlGetInt64("hw.memsize", 0);
|
||||
if(ram->bytesTotal == 0)
|
||||
{
|
||||
ffStrbufAppendS(&ram->error, "Failed to read hw.memsize");
|
||||
@@ -28,21 +28,21 @@ static void detectRam(FFMemoryStorage* ram)
|
||||
return;
|
||||
}
|
||||
|
||||
memory->ram.bytesUsed = ((uint64_t) vmstat.active_count + vmstat.wire_count) * pagesize;
|
||||
ram->bytesUsed = ((uint64_t) vmstat.active_count + vmstat.wire_count) * pagesize;
|
||||
}
|
||||
|
||||
static void detectSwap(FFMemoryStorage* swap)
|
||||
{
|
||||
struct xsw_usage swap;
|
||||
size_t size = sizeof(swap);
|
||||
if(sysctlbyname("vm.swapusage", &swap, &size, 0, 0) != 0)
|
||||
struct xsw_usage xsw;
|
||||
size_t size = sizeof(xsw);
|
||||
if(sysctlbyname("vm.swapusage", &xsw, &size, 0, 0) != 0)
|
||||
{
|
||||
ffStrbufAppendS(&swap->error, "Failed to read vm.swapusage");
|
||||
return;
|
||||
}
|
||||
|
||||
memory->swap.bytesTotal = swap.xsu_total;
|
||||
memory->swap.bytesUsed = swap.xsu_used;
|
||||
swap->bytesTotal = xsw.xsu_total;
|
||||
swap->bytesUsed = xsw.xsu_used;
|
||||
}
|
||||
|
||||
void ffDetectMemoryImpl(FFMemoryResult* memory)
|
||||
|
||||
Reference in New Issue
Block a user