Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POSIX Port: Round up stack sizes correctly on macOS
On macOS, pthread_attr_setstacksize requires the stack size to be a multiple of the system page size. The previous changes here assumed the use of pthread_attr_setstack, however the transition to pthread_attr_setstacksize means we can avoid rounding the pxEndOfStack pointer. This is additionally positive because pxEndOfStack was actually being rounded in the wrong direction -- it ought to have been rounded down (_trunc) instead of up due to the stack growth direction. In my case this actually caused pxEndOfStack to end up after pxTopOfStack, which underflowed and created a huge stack size request + EXC_BAD_ACCESS in pthread_create. Signed-off-by: Paul Hollinsky <paulhollinsky@gmail.com>
- Loading branch information