STINNER Victor <vstin...@redhat.com> added the comment:
About the stack memory usage, in the past, I used a subfunction tagged with _Py_NO_INLINE to work on temporary stack but then drop it: void function() { subfunction(); /* use temporary stack */ /* don't waste stack memory */ ... } I'm not sure if such pattern could be used here for things like " PyObject *argsbuf[12];". The problem is that argument parsing uses a lot of local variables allocated on the stack. In practice, it's more like: void function(args) { int x; parse_args(args, &x); /* use temporary stack */ /* don't waste stack memory */ ... } I expect a long list of "&arg" where arg is a local variable of function(). Well, that's basically the design of the current PyArg_ParseTuple() function family :-) PyArg_ParseTuple() does its stuff in private and uses more stack memory, but once PyArg_ParseTuple() returns, the memory on the stack is "released" just because we exited the function. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36127> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com