8000 [WIP] bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). by ericsnowcurrently · Pull Request #9334 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[WIP] bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). #9334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Next Next commit
Zero-out PyInterpreterState when initializing.
  • Loading branch information
ericsnowcurrently committed Sep 14, 2018
commit 3b8cb643e1e304275c3e67407862801c674e1926
25 changes: 1 addition & 24 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,42 +134,19 @@ PyInterpreterState_New(void)
return NULL;
}

memset(interp, 0, sizeof(*interp));
interp->id_refcount = -1;
interp->id_mutex = NULL;
interp->modules = NULL;
interp->modules_by_index = NULL;
interp->sysdict = NULL;
interp->builtins = NULL;
interp->builtins_copy = NULL;
interp->tstate_head = NULL;
interp->check_interval = 100;
interp->num_threads = 0;
interp->pythread_stacksize = 0;
interp->codec_search_path = NULL;
interp->codec_search_cache = NULL;
interp->codec_error_registry = NULL;
interp->codecs_initialized = 0;
interp->fscodec_initialized = 0;
interp->core_config = _PyCoreConfig_INIT;
interp->config = _PyMainInterpreterConfig_INIT;
interp->importlib = NULL;
interp->import_func = NULL;
interp->eval_frame = _PyEval_EvalFrameDefault;
interp->co_extra_user_count = 0;
#ifdef HAVE_DLOPEN
#if HAVE_DECL_RTLD_NOW
interp->dlopenflags = RTLD_NOW;
#else
interp->dlopenflags = RTLD_LAZY;
#endif
#endif
#ifdef HAVE_FORK
interp->before_forkers = NULL;
interp->after_forkers_parent = NULL;
interp->after_forkers_child = NULL;
#endif
interp->pyexitfunc = NULL;
interp->pyexitmodule = NULL;

HEAD_LOCK();
if (_PyRuntime.interpreters.next_id < 0) {
Expand Down
0