Issue #7544: Preallocate thread memory before creating the thread to avoid a
fatal error in low memory condition.
diff --git a/Include/pystate.h b/Include/pystate.h
index 4919d99..b9fe61e 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -105,6 +105,8 @@
 PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
 
 PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);
+PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);
+PyAPI_FUNC(void) _PyThreadState_Init(PyThreadState *);
 PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
 PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
 #ifdef WITH_THREAD