Many programming language implementations use a fixed-size function call stack; sizes from64KB to 2MB are typical. Fixed-size stacks impose a limit on the depth of rec ursion, so one must be careful to avoid a stack overflow when traversing large dat a structures recursively;fixed-size stacks may even pose a security risk. In contrast, typical Go implementations use variable-size stacks that start small and grow as needed up to a limit on the order of
a gigabyte.This lets us use recursion safely and without worrying about overflow.
golang implement the stack size of function ,maybe using heap memory not dependent on system operation.
有疑问加站长微信联系(非本文作者)