Skip to content
Merged
2 changes: 1 addition & 1 deletion Include/internal/pycore_ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ _Py_VectorCallInstrumentation_StackRefSteal(
PyThreadState* tstate);

PyAPI_FUNC(PyObject *)
_Py_BuiltinCallFast_StackRefSteal(
_Py_BuiltinCallFast_StackRef(
_PyStackRef callable,
_PyStackRef *arguments,
int total_args);
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Include/internal/pycore_stackref.h
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,18 @@ _Py_TryXGetStackRef(PyObject **src, _PyStackRef *out)
} \
} while (0)

static inline void
_PyStackRef_CloseStack(_PyStackRef *arguments, int total_args)
{
// arguments is a pointer into the GC visible stack,
// so we must NULL out values as we clear them.
for (int i = total_args-1; i >= 0; i--) {
_PyStackRef tmp = arguments[i];
arguments[i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
}

#ifdef __cplusplus
}
#endif
Expand Down
Loading
Loading