From e8e9f2b67abbf9f13e74a0fcd80198ddb7523cb1 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 11 Mar 2020 05:14:21 -0400 Subject: [PATCH] [wasm] Fix warnings about unused variables. (#33451) /s/mono2/mono/metadata/sgen-mono.c:2883:16: warning: unused variable 'last_major_gc_warned' [-Wunused-variable] static gint32 last_major_gc_warned = -1; ^ /s/mono2/mono/metadata/sgen-mono.c:2884:16: warning: unused variable 'num_degraded' [-Wunused-variable] static gint32 num_degraded = 0; ^ /s/mono2/mono/metadata/sgen-mono.c:2886:9: warning: unused variable 'major_gc_count' [-Wunused-variable] gint32 major_gc_count = mono_atomic_load_i32 (&mono_gc_stats.maj... ^ Co-authored-by: jaykrell --- src/mono/mono/metadata/sgen-mono.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/metadata/sgen-mono.c b/src/mono/mono/metadata/sgen-mono.c index f298d6a..6661f40 100644 --- a/src/mono/mono/metadata/sgen-mono.c +++ b/src/mono/mono/metadata/sgen-mono.c @@ -2884,12 +2884,12 @@ mono_gc_add_memory_pressure (gint64 value) void sgen_client_degraded_allocation (void) { + //The WASM target aways triggers degrated allocation before collecting. So no point in printing the warning as it will just confuse users +#ifndef HOST_WASM static gint32 last_major_gc_warned = -1; static gint32 num_degraded = 0; gint32 major_gc_count = mono_atomic_load_i32 (&mono_gc_stats.major_gc_count); - //The WASM target aways triggers degrated allocation before collecting. So no point in printing the warning as it will just confuse users -#if !defined (TARGET_WASM) if (mono_atomic_load_i32 (&last_major_gc_warned) < major_gc_count) { gint32 num = mono_atomic_inc_i32 (&num_degraded); if (num == 1 || num == 3) -- 2.7.4