From 49fe080f2ae4e380a8b7d190464418f442340c4f Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 26 Aug 2025 15:05:53 +0800 Subject: meminfo.c: no vmstat.compressor_page_count on < 10.7 --- core/src/xmake/os/meminfo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/src') diff --git a/core/src/xmake/os/meminfo.c b/core/src/xmake/os/meminfo.c index d69e178ad..293359350 100644 --- a/core/src/xmake/os/meminfo.c +++ b/core/src/xmake/os/meminfo.c @@ -35,6 +35,7 @@ # include # include # include +# include #elif defined(TB_CONFIG_OS_LINUX) # include # include @@ -65,7 +66,11 @@ static tb_bool_t xm_os_meminfo_stats(tb_int_t* ptotalsize, tb_int_t* pavailsize) if (host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info_t) &vmstat, &count) == KERN_SUCCESS) { tb_int_t pagesize = (tb_int_t)tb_page_size(); - tb_int64_t totalsize = (tb_int64_t)(vmstat.inactive_count + vmstat.free_count + vmstat.active_count + vmstat.wire_count + vmstat.compressor_page_count) * pagesize; + tb_int64_t totalsize = (tb_int64_t)(vmstat.inactive_count + vmstat.free_count + vmstat.active_count + vmstat.wire_count +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + + vmstat.compressor_page_count +#endif + ) * pagesize; /* * NB: speculative pages are already accounted for in "free_count", * so "speculative_count" is the number of "free" pages that are -- cgit v1.3.1