[runtime] Use no-op for SufficientExecutionStack on Linux (#5543)
authorAlexander Kyte <alexmkyte@gmail.com>
Tue, 12 Sep 2017 19:46:18 +0000 (15:46 -0400)
committerLudovic Henry <ludovic@xamarin.com>
Tue, 12 Sep 2017 19:46:18 +0000 (15:46 -0400)
We had previously responded to bad performance on android by stubbing out
ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack
on android. This was necessary because the call to pthread_attr_getstack ()
will read /proc/self/maps. When used inside of a hot function, the performance is terrible.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58911

mono/metadata/icall.c

index 2e485848486d0363b3b7d0929849fcec894b26b6..f55ed1f1847600caf96c9aced596651945e01320 100644 (file)
@@ -1014,7 +1014,7 @@ ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStac
 {
 #if defined(TARGET_WIN32) || defined(HOST_WIN32)
        // It does not work on win32
-#elif defined(TARGET_ANDROID)
+#elif defined(TARGET_ANDROID) || defined(__linux__)
        // No need for now
 #else
        guint8 *stack_addr;