@@ -432,7 +432,7 @@ def recursive_call(self, node, level):
432432
433433 def funcHeader (self , name ):
434434 ctype = get_c_type (name )
435- self .emit ("int" , 0 )
435+ self .emit ("Py_LOCAL_INLINE( int) " , 0 )
436436 self .emit ("obj2ast_%s(struct ast_state *state, PyObject* obj, %s* out, PyArena* arena)" % (name , ctype ), 0 )
437437 self .emit ("{" , 0 )
438438 self .emit ("int isinstance;" , 1 )
@@ -514,7 +514,7 @@ def visitSum(self, sum, name):
514514
515515 def visitProduct (self , prod , name ):
516516 ctype = get_c_type (name )
517- self .emit ("int" , 0 )
517+ self .emit ("Py_LOCAL_INLINE( int) " , 0 )
518518 self .emit ("obj2ast_%s(struct ast_state *state, PyObject* obj, %s* out, PyArena* arena)" % (name , ctype ), 0 )
519519 self .emit ("{" , 0 )
520520 self .emit ("PyObject* tmp = NULL;" , 1 )
@@ -1434,6 +1434,11 @@ def generate_module_def(mod, f, internal_h):
14341434 generate_ast_state (module_state , internal_h )
14351435
14361436 print (textwrap .dedent ("""
1437+ /* enable more aggressive intra-module optimizations, where available
1438+ to reduce the stack usage for windows. */
1439+
1440+ #define PY_LOCAL_AGGRESSIVE
1441+
14371442 #include "Python.h"
14381443 #include "pycore_ast.h"
14391444 #include "pycore_ast_state.h" // struct ast_state
0 commit comments