n3ds systhread - use 80kb thread stack size as default, remove hard cap

This commit is contained in:
ds-sloth 2023-10-24 19:12:14 -04:00 committed by Sam Lantinga
parent 301ee21f33
commit 3823ba1ded

View File

@ -26,9 +26,8 @@
#include "../SDL_systhread.h" #include "../SDL_systhread.h"
/* N3DS has very limited RAM (128MB), so we put a limit on thread stack size. */ /* N3DS has very limited RAM (128MB), so we set a low default thread stack size. */
#define N3DS_THREAD_STACK_SIZE_MAX (16 * 1024) #define N3DS_THREAD_STACK_SIZE_DEFAULT (80 * 1024)
#define N3DS_THREAD_STACK_SIZE_DEFAULT (4 * 1024)
#define N3DS_THREAD_PRIORITY_LOW 0x3F /**< Minimum priority */ #define N3DS_THREAD_PRIORITY_LOW 0x3F /**< Minimum priority */
#define N3DS_THREAD_PRIORITY_MEDIUM 0x2F /**< Slightly higher than main thread (0x30) */ #define N3DS_THREAD_PRIORITY_MEDIUM 0x2F /**< Slightly higher than main thread (0x30) */
@ -80,14 +79,6 @@ static size_t GetStackSize(size_t requested_size)
return N3DS_THREAD_STACK_SIZE_DEFAULT; return N3DS_THREAD_STACK_SIZE_DEFAULT;
} }
if (requested_size > N3DS_THREAD_STACK_SIZE_MAX) {
SDL_LogWarn(SDL_LOG_CATEGORY_SYSTEM,
"Requested a thread size of %zu,"
" falling back to the maximum supported of %zu\n",
requested_size,
N3DS_THREAD_STACK_SIZE_MAX);
requested_size = N3DS_THREAD_STACK_SIZE_MAX;
}
return requested_size; return requested_size;
} }