From c5999683ce64288ede068716765cd437f83b28ec 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 453c5718d3d4..ff85a0bf3479 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;