Issue #7544: Preallocate thread memory before creating the thread to avoid a

fatal error in low memory condition.
This commit is contained in:
Victor Stinner 2010-03-03 23:20:25 +00:00
parent 2379bb664a
commit 71fb87e64c
4 changed files with 38 additions and 7 deletions

View file

@ -105,6 +105,8 @@ PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
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