cpython
cpython copied to clipboard
Avoid excessive stack usage in all cases.
In 3.11 we asserted that we didn't use too much stack, but that failed https://github.com/python/cpython/issues/94329
If we can guarantee that no code object uses more than a certain number of slots, N, where N should be in the order of a 100, we can potentially simplify and speed up bounds and recursion checking by combining them.
It also means we can use fixed size chunks for the frame stack, as we know that no frame can be larger than a chunk.
- PR: gh-99237
- PR: gh-99262