mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-91079: Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now (GH130413)
Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now
Unfortunatlely, the change broke some buildbots.
This reverts commit 2498c22fa0
.
This commit is contained in:
parent
0ff1611574
commit
ef29104f7d
47 changed files with 1466 additions and 1220 deletions
|
@ -115,11 +115,7 @@ static PyObject*
|
|||
get_c_recursion_remaining(PyObject *self, PyObject *Py_UNUSED(args))
|
||||
{
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
char here;
|
||||
uintptr_t here_addr = (uintptr_t)&here;
|
||||
_PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate;
|
||||
int remaining = (int)((here_addr - _tstate->c_stack_soft_limit)/PYOS_STACK_MARGIN_BYTES * 50);
|
||||
return PyLong_FromLong(remaining);
|
||||
return PyLong_FromLong(tstate->c_recursion_remaining);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue