Skip to content

Commit

Permalink
Set stack size when InstallationManager loads (#4615)
Browse files Browse the repository at this point in the history
Set up a custom stack size for the InstallationManager load. On Android
platforms, the default stack size is insufficient, leading to stack
overflow issues.

b/384959489
  • Loading branch information
kaidokert authored Dec 30, 2024
2 parents 81531bb + 74f8c87 commit 0491681
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions starboard/android/shared/android_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ extern "C" SB_EXPORT_PLATFORM void GameActivity_onCreate(
pthread_attr_init(&attributes);
pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED);

// 1MB (Android default) stack size is not enough
// for "installation_manager". Change it to 2MB.
pthread_attr_setstacksize(&attributes, 2 * (1024 * 1024));

pthread_create(&g_starboard_thread, &attributes, &ThreadEntryPoint,
&semaphore);

Expand Down

0 comments on commit 0491681

Please sign in to comment.