One of the reasons goroutines are considered &#x27;lightweight&#x27; is that they allocate a small stack to begin with which is reallocated and moved if more space is needed. Of course, stack-moving isn&#x27;t possible in C for various reasons.<p>What does libmill do here? Does it allocate a large stack right off the bat? What happens in a stack overflow, does it segfault or will it just trample over whatever is beneath it?<p>Edit: an ounce of investigation is worth a pound of answered questions, or something like that. It appears stack sizes are configurable, but default to 256kb [1] (for scale, go defaults to 2k), and are retained in a cache of size 64 [#L72] (by default). Also the bottom page is used as a stack guard if posix and mprotect are available [#L90].<p>From a cursory glance there appears to be some data races in the stack allocation code, though I could be mistaken. E.g. stack.c#L137<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;sustrik&#x2F;libmill&#x2F;blob&#x2F;master&#x2F;stack.c#L47" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sustrik&#x2F;libmill&#x2F;blob&#x2F;master&#x2F;stack.c#L47</a>