On modern Unix systems it is possible to estimate remaining stack space with reasonable accuracy by combining stack limits and the current stack pointer.
The article explores three approaches (getrlimit, pthread_getattr_np, and constructor initialization) and demonstrates a small helper API to inspect available stack space at runtime
The article explores three approaches (getrlimit, pthread_getattr_np, and constructor initialization) and demonstrates a small helper API to inspect available stack space at runtime