On Tue, 19 Jan 2021 16:28:46 +0000 Mark Shannon wrote:
On 19/01/2021 4:15 pm, Antoine Pitrou wrote:
On Tue, 19 Jan 2021 15:54:39 +0000 Mark Shannon wrote:
On 19/01/2021 3:40 pm, Antoine Pitrou wrote:
On Tue, 19 Jan 2021 13:31:45 +0000 Mark Shannon wrote:
Hi everyone,
It's time for yet another PEP :)
Fortunately, this one is a small one that doesn't change much. It's aim is to make the VM more robust.
On the principle, no objection.
In practice, can you show how an implementation of Py_CheckStackDepth() would look like?
It would depend on the platform, but a portable-ish implementation is here:
https://github.com/markshannon/cpython/blob/pep-overflow-implementation/Incl...
This doesn't tell me how `stack_limit_pointer` is computed or estimated :-)
It's nothing clever, and the numbers I've chosen are just off the top of my head.
https://github.com/markshannon/cpython/blob/pep-overflow-implementation/Modu...
What about the main thread? Is `stack_limit_pointer` some kind of thread-local? I suppose nothing stops an OS to use different virtual addresses for the stacks of different threads (especially if randomization of stack addresses is desired). Regards Antoine.