threads: fix size calc

This commit is contained in:
Michael Scire 2019-10-18 19:15:22 -07:00
parent 23bf733519
commit 5e6afed4db

View File

@ -208,7 +208,7 @@ Result threadClose(Thread* t) {
const size_t tls_sz = (__tls_end-__tls_start+0xF) &~ 0xF; const size_t tls_sz = (__tls_end-__tls_start+0xF) &~ 0xF;
const size_t reent_sz = (sizeof(struct _reent)+0xF) &~ 0xF; const size_t reent_sz = (sizeof(struct _reent)+0xF) &~ 0xF;
const size_t aligned_stack_sz = (t->stack_sz + tls_sz + reent_sz + 0xFFF) & ~0xFFF; const size_t aligned_stack_sz = (t->stack_sz + sizeof(ThreadEntryArgs) + tls_sz + reent_sz + 0xFFF) & ~0xFFF;
rc = svcUnmapMemory(t->stack_mirror, t->stack_mem, aligned_stack_sz); rc = svcUnmapMemory(t->stack_mirror, t->stack_mem, aligned_stack_sz);