Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
correct initialization code
Explicitly initialize struct members rather than relying on compiler extensions.
  • Loading branch information
benjaminp committed Sep 6, 2017
commit b9a2da7c16f45305cfc3c785be0834258a3da7fa
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *);
extern void _PyGILState_Fini(void);
#endif /* WITH_THREAD */

_PyRuntimeState _PyRuntime = {};
_PyRuntimeState _PyRuntime = {0, 0};

void
_PyRuntime_Initialize(void)
Expand Down
3 changes: 1 addition & 2 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ extern "C" {
void
_PyRuntimeState_Init(_PyRuntimeState *runtime)
{
_PyRuntimeState initial = {};
*runtime = initial;
memset(runtime, 0, sizeof(*runtime));

_PyObject_Initialize(&runtime->obj);
_PyMem_Initialize(&runtime->mem);
Expand Down