Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

2KiB is a peculiar size. Typical page size is 4KiB, and you probably want to allocate two pages - one for the stack and one for a guard page for stack overflow protection. That means that a fibers' minimal size ought to be 8KiB.


You should look into how go manages goroutines. It is indeed 2kib stacks by default without the need for guard pages. They use a different mechanism to determine overflows. Other runtimes can do similar things.


Aha, yeah. It utilizes the compiler to insert guards at each function prologue, determining the remaining stack size.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: