3 ms·
> I'm sure there's hijinks you can perform with mmap to add a couple more pages if you so desire. I don't think you can do that, but I think you'd just create
by masklinn 8y ago
> I'm sure there's hijinks you can perform with mmap to add a couple more pages if you so desire.
I don't think you can do that, but I think you'd just create a bigger stack when spawning your process / thread: the stack allocation is virtual (at least on unices, possibly not on Windows?) so on a 64b system it's unlikely to be very expensive, physical pages will get allocated on-demand as stack use increases.
This could probably be tested / benched using pthread: pthread_attr_setstacksize lets you define the (virtual) stack size before spawning the process.