diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2017-09-11 11:51:50 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2017-09-11 11:51:50 +0000 |
commit | 16f78fdf58f794d91cc57b5d947da9df3fa4eb6e (patch) | |
tree | c610415b0eae6b57f6eedf197a54755c91f32b77 /games/openbor3482 | |
parent | 9e35ea9bb04e09671cbaa9a4276b421f88046f6b (diff) | |
download | ports-16f78fdf58f794d91cc57b5d947da9df3fa4eb6e.tar.gz ports-16f78fdf58f794d91cc57b5d947da9df3fa4eb6e.zip |
games/openbor: simplify initialization of sysctl values
Notes
Notes:
svn path=/head/; revision=449628
Diffstat (limited to 'games/openbor3482')
-rw-r--r-- | games/openbor3482/files/patch-source_ramlib_ram.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/games/openbor3482/files/patch-source_ramlib_ram.c b/games/openbor3482/files/patch-source_ramlib_ram.c index ea89f1717897..c1609f723ea0 100644 --- a/games/openbor3482/files/patch-source_ramlib_ram.c +++ b/games/openbor3482/files/patch-source_ramlib_ram.c @@ -71,7 +71,7 @@ Implement Linux-like memory stats for BSDs ///////////////////////////////////////////////////////////////////////////// // Functions -@@ -101,6 +136,49 @@ u64 getFreeRam(int byte_size) +@@ -101,6 +136,48 @@ u64 getFreeRam(int byte_size) if(host_page_size(hostPort, &size) != KERN_SUCCESS) return 0; if(host_statistics(hostPort, HOST_VM_INFO, (host_info_t)&vms, &count) != KERN_SUCCESS) return 0; return (u64)(((vms.inactive_count+vms.free_count)*size)/byte_size); @@ -85,9 +85,8 @@ Implement Linux-like memory stats for BSDs + return (u64)((vms.v_free_count + vms.v_inactive_count + + vms.v_cache_count) * getpagesize()) / byte_size; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -+ u_int v_free_count, v_inactive_count, v_cache_count; ++ u_int v_free_count = 0, v_inactive_count = 0, v_cache_count = 0; + size_t sz = sizeof(u_int); -+ v_free_count = v_inactive_count = v_cache_count = 0; + sysctlbyname("vm.stats.vm.v_free_count", + &v_free_count, &sz, NULL, 0); + sysctlbyname("vm.stats.vm.v_inactive_count", |