GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-36854: Move GC runtime state from _PyRuntimeState to PyInterpreterState. by ericsnowcurrently · Pull Request #13219 · python/cpython Conversation
|
| // This will unblock any joining threads. | ||
| tstate->on_delete(tstate->on_delete_data); | ||
| tstate->on_delete = NULL; | ||
| tstate->on_delete_data = NULL; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This change looks to be unrelated. If it's related, I would prefer to see it as a separated PR to prepare that one.
Same comment for other thread changes:
// All threading module threads are marked as "done" later
// in PyThreadState_Clear().
and
// This will unblock any joining threads.
// We also do this in PyThreadState_Clear(), but do it here to be sure.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| filename, lineno, "_PyObject_GC_TRACK"); | ||
|
|
||
| PyGC_Head *last = (PyGC_Head*)(_PyRuntime.gc.generation0->_gc_prev); | ||
| PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to use a "struct _gc_runtime_state *state" variable instead?
struct _gc_runtime_state *state = &_PyInterpreterState_GET_UNSAFE()->gc;
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /*[clinic end generated code: output=45a427e9dce9155c input=81ac4940ca579707]*/ | ||
| { | ||
| _PyRuntime.gc.enabled = 1; | ||
| PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to use a "struct _gc_runtime_state *state" variable instead?
struct _gc_runtime_state *state = &_PyInterpreterState_GET_UNSAFE()->gc;
If the line is too lone, maybe add a GET_STATE() macro which returns &_PyInterpreterState_GET_UNSAFE()->gc.
Same comment for the whole file. I would prefer to avoid introducing "PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); " lines if it's only used to get the GC state.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| { | ||
| while (_PyRuntime.gc.trash_delete_later) { | ||
| PyObject *op = _PyRuntime.gc.trash_delete_later; | ||
| PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Again, a "state" variable would be more appropriate here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| *interp_p = interp; | ||
|
|
||
| _PyGC_Initialize(&interp->gc); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hum, maybe _PyGC_Initialize() should take interp argument instead, to be consistent with other _PyGC functions.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ericsnowcurrently, were you wanting to land this for 3.8? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I wrote a different change, PR #17287, that I just merged. So I close this old PR. Thanks anyway Eric for working on this, my work is partially based on yours ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for doing it!!! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You're welcome. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.