Fix FreeBSD build errors (again)

This commit is contained in:
Gustaf Alhäll 2023-10-19 18:05:16 +02:00
parent 981b2029aa
commit b544c4202a
No known key found for this signature in database
GPG key ID: 333455C5B7ED2E87

View file

@ -3038,11 +3038,11 @@ size_t I_GetFreeMem(size_t *total)
#ifdef FREEBSD
u_int v_free_count, v_page_size, v_page_count;
size_t size = sizeof(v_free_count);
sysctlbyname("vm.stat.vm.v_free_count", &v_free_count, &size, NULL, 0);
size_t size = sizeof(v_page_size);
sysctlbyname("vm.stat.vm.v_page_size", &v_page_size, &size, NULL, 0);
size_t size = sizeof(v_page_count);
sysctlbyname("vm.stat.vm.v_page_count", &v_page_count, &size, NULL, 0);
sysctlbyname("vm.stats.vm.v_free_count", &v_free_count, &size, NULL, 0);
size = sizeof(v_page_size);
sysctlbyname("vm.stats.vm.v_page_size", &v_page_size, &size, NULL, 0);
size = sizeof(v_page_count);
sysctlbyname("vm.stats.vm.v_page_count", &v_page_count, &size, NULL, 0);
if (total)
*total = v_page_count * v_page_size;