diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-03-18 17:04:06 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-03-18 17:04:06 +0100 |
| commit | c519556962efc341119839f6b642331ef6e9bdee (patch) | |
| tree | edfea9c28b9a0c860316ca9dc4d0b1e29a410b47 /src/libtools | |
| parent | c7280d93129b94fae9fc12bd3f1f746541b9aaa2 (diff) | |
| download | box64-c519556962efc341119839f6b642331ef6e9bdee.tar.gz box64-c519556962efc341119839f6b642331ef6e9bdee.zip | |
[BOX32] Small change on memory managment again
Diffstat (limited to 'src/libtools')
| -rwxr-xr-x | src/libtools/threads32.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c index ac75e4c3..3f43d8db 100755 --- a/src/libtools/threads32.c +++ b/src/libtools/threads32.c @@ -186,10 +186,15 @@ EXPORT int my32_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_r if(attr) { size_t stsize; + static size_t minsize = 0; + if(!minsize) { + minsize = PTHREAD_STACK_MIN; + if(minsize<512*1024) minsize = 512*1024; + } if(pthread_attr_getstacksize(get_attr(attr), &stsize)==0) stacksize = stsize; - if(stacksize<512*1024) // emu and all needs some stack space, don't go too low - pthread_attr_setstacksize(get_attr(attr), 512*1024); + if(stacksize<minsize) // emu and all needs some stack space, don't go too low + pthread_attr_setstacksize(get_attr(attr), minsize); } if(GetStackSize((uintptr_t)attr, &attr_stack, &attr_stacksize)) { |