Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Fix broken os.totalmem() on FreeBSD amd64 #1233

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/platform_freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,9 @@ double Platform::GetFreeMemory() {
}

double Platform::GetTotalMemory() {
#if defined(HW_PHYSMEM64)
uint64_t info;
static int which[] = {CTL_HW, HW_PHYSMEM64};
#else
unsigned int info;
unsigned long info;
static int which[] = {CTL_HW, HW_PHYSMEM};
#endif

size_t size = sizeof(info);

if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
Expand Down