mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-20 05:40:17 +08:00
Async functions and generators run on their own fiber stacks. The new stack-overflow guard keeps a quarter of each stack as a reserve for unwinding and error reporting, which cut the depth they could recurse to from 256 KiB to 192 KiB of frames. Moderately deep recursion inside an async body or generator then threw RangeError where Node runs it, for example 3000 frames of an unoptimized build on arm64 macOS. Fibers now get 512 KiB, which leaves 384 KiB after the reserve. Pages are still committed lazily, so idle and shallow fibers cost address space, not memory. The corpus pins recursion inside async functions and generators next to deeper recursion on the main stack.