Fourteen Thousand Frames Deep
A recursive traversal is compiled at -O0. Each activation of the function occupies 560 bytes: a 512-byte local scratch array plus 48 bytes of return address, saved frame pointer, spilled arguments and 16-byte alignment padding. The thread runs with the default ulimit -s 8192, an 8 MiB stack.
Roughly how many frames deep can the recursion go before it touches the guard page?
Sign in to answer questions and track your progress
Sign In