From 568d6e532b65c6441e5ea8ee873e68055a2f5841 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 10 Sep 2020 18:49:19 +0000 Subject: [PATCH] Haiku build fix. Haiku does not provide page faults statistics only system wide. --- src/stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stats.c b/src/stats.c index 842e200..099dea7 100644 --- a/src/stats.c +++ b/src/stats.c @@ -497,7 +497,9 @@ static void mi_stat_process_info(mi_msecs_t* utime, mi_msecs_t* stime, size_t* c getrusage(RUSAGE_SELF, &rusage); *utime = timeval_secs(&rusage.ru_utime); *stime = timeval_secs(&rusage.ru_stime); +#if !defined(__HAIKU__) *page_faults = rusage.ru_majflt; +#endif // estimate commit using our stats *peak_commit = (size_t)(mi_atomic_loadi64_relaxed((_Atomic(int64_t)*)&_mi_stats_main.committed.peak)); *current_commit = (size_t)(mi_atomic_loadi64_relaxed((_Atomic(int64_t)*)&_mi_stats_main.committed.current));