When do you worry about stack size?

前端 未结 19 986
难免孤独
难免孤独 2020-12-10 12:41

When you are programming in a language that allows you to use automatic allocation for very large objects, when and how do you worry about stack size? Are there any rules o

19条回答
  •  时光说笑
    2020-12-10 13:38

    You start to worry about stack size when

    • someone on your team cunningly invents a recursive function that goes on and on and on...
    • you create a thread factory and suddenly need a tenfold of the stack that you used to need (each thread needs a stack => the more threads you have, the less free space remains for a given stack size)

提交回复
热议问题