dolphin/Source/Android/jni
JosJuice 86c1f6e1e7 Jit: Don't use a second stack
This second stack leads to JNI problems on Android, because ART fetches
the address and size of the original stack using pthread functions
(see GetThreadStack in art/runtime/thread.cc), and (presumably) treats
stack addresses outside of the original stack as invalid. (What I don't
understand is why some JNI operations on the CPU thread work fine
despite this but others don't.)

Instead of creating a second stack, let's borrow the approach ART uses:
Use pthread functions to find out the stack's address and size, then
install guard pages at an appropriate location. This lets us get rid
of a workaround we had in the MsgAlert function.

Because we're no longer choosing the stack size ourselves, I've made some
tweaks to where the put the guard pages. Previously we had a stack of
2 MiB and a safe zone of 512 KiB. We now accept stacks as small as 512 KiB
(used on macOS) and use a safe zone of 256 KiB. I feel like this should
be fine, but haven't done much testing beyond "it seems to work".

By the way, on Windows it was already the case that we didn't create
a second stack... But there was a bug in the implementation!
The code for protecting the stack has to run on the CPU thread, since
it's the CPU thread's stack we want to protect, but it was actually
running on EmuThread. This commit fixes that, since now this bug
matters on other operating systems too.
2023-02-28 20:29:46 +01:00
..
AndroidCommon AndroidCommon: Make use of std::string_view where applicable 2023-01-30 13:30:52 -05:00
Cheats Android: Add VectorToJObjectArray utility function 2022-12-27 22:59:42 +01:00
Config Integrate "Ignore for this session" better with config system 2022-09-24 13:03:45 +02:00
GameList Android: Make more meticulous use of DeleteLocalRef 2022-12-27 22:03:44 +01:00
Input Android: Use input override system for touch controls 2022-10-03 22:04:09 +02:00
CMakeLists.txt Android: Add Skylanders Portal 2023-02-02 21:16:14 +13:00
IniFile.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
MainAndroid.cpp Jit: Don't use a second stack 2023-02-28 20:29:46 +01:00
RiivolutionPatches.cpp Android: Add Riivolution patch configuration 2021-10-30 23:24:37 +02:00
SkylanderConfig.cpp Android: Add Skylanders Portal 2023-02-02 21:16:14 +13:00
WiiUtils.cpp Show vWii System Menu version in Menu Bar 2022-10-22 13:36:55 +02:00