Skip to content

Commit d9a1e51

Browse files
committed
Merge branch 'bs/total-ram-bsd'
Update total_ram() functrion on BSD variants. * bs/total-ram-bsd: builtin/gc: correct physical memory detection for OpenBSD / NetBSD
2 parents 86c32bb + 35c1d59 commit d9a1e51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin/gc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,16 @@ static uint64_t total_ram(void)
516516
total *= (uint64_t)si.mem_unit;
517517
return total;
518518
}
519-
#elif defined(HAVE_BSD_SYSCTL) && (defined(HW_MEMSIZE) || defined(HW_PHYSMEM))
519+
#elif defined(HAVE_BSD_SYSCTL) && (defined(HW_MEMSIZE) || defined(HW_PHYSMEM) || defined(HW_PHYSMEM64))
520520
int64_t physical_memory;
521521
int mib[2];
522522
size_t length;
523523

524524
mib[0] = CTL_HW;
525525
# if defined(HW_MEMSIZE)
526526
mib[1] = HW_MEMSIZE;
527+
# elif defined(HW_PHYSMEM64)
528+
mib[1] = HW_PHYSMEM64;
527529
# else
528530
mib[1] = HW_PHYSMEM;
529531
# endif

0 commit comments

Comments
 (0)