mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-29 09:33:48 +00:00
Parsing and translating an expression recurse once per level of nesting, so the frame size of those functions decides how deep an expression can be on a given stack. There was no way to see those sizes or where the stack goes at the deepest point. - frame-sizes.sh reads the frame size of every function from its prologue (aarch64 and x86_64), and compares two binaries with -c. - min-stack.sh finds the smallest main-thread stack that runs SQL scripts, per binary, with sqlite3 as a reference. - stack-profile.sh runs a script under lldb with a stack just too small, so it overflows at its deepest point, and sums the stack bytes per function from the stack pointers of the backtrace. stack-profile.sh starts the binary through a small C launcher that sets the stack limit and then execs, because lldb's debug server cannot run under a small `ulimit -s` and lldb cannot debug a system shell on macOS.