hot-fix: Enforce minimum stack size of 64KB
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

Fixes some crashes in BB from unity pt 1
This commit is contained in:
TheTurtle 2024-12-11 21:17:55 +02:00 committed by GitHub
parent b82993c568
commit 0a9c437ec8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -243,6 +243,13 @@ int PS4_SYSV_ABI posix_pthread_create_name_np(PthreadT* thread, const PthreadAtt
static int TidCounter = 1;
new_thread->tid = ++TidCounter;
if (new_thread->attr.stackaddr_attr == 0) {
/* Enforce minimum stack size of 64 KB */
static constexpr size_t MinimumStack = 64_KB;
auto& stacksize = new_thread->attr.stacksize_attr;
stacksize = std::max(stacksize, MinimumStack);
}
if (thread_state->CreateStack(&new_thread->attr) != 0) {
/* Insufficient memory to create a stack: */
thread_state->Free(curthread, new_thread);