From 420b6db8e0f65fe9391e10b7f083583ce977c90d Mon Sep 17 00:00:00 2001 From: Jonathan Chambers Date: Thu, 20 Apr 2023 14:13:15 -0400 Subject: [PATCH] Avoid GC transitions when they are not needed. If hybrid or coop is not supported by the build, it will never be needed at runtime by the generated native/icall wrappers. This improves performance of native wrappers. --- mono/metadata/marshal-ilgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mono/metadata/marshal-ilgen.c b/mono/metadata/marshal-ilgen.c index d1388bc818c3..f1c4e656c568 100644 --- a/mono/metadata/marshal-ilgen.c +++ b/mono/metadata/marshal-ilgen.c @@ -1908,7 +1908,7 @@ gc_safe_transition_builder_init (GCSafeTransitionBuilder *builder, MonoMethodBui #ifndef DISABLE_COM builder->coop_cominterop_fnptr = -1; #endif -#if defined (TARGET_WASM) +#if defined (TARGET_WASM) || !(defined(ENABLE_HYBRID_SUSPEND) || defined(ENABLE_COOP_SUSPEND)) return FALSE; #else return TRUE;