8000 bpo-35081: Move _PyObject_GC_TRACK() to pycore_object.h by vstinner · Pull Request #10276 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-35081: Move _PyObject_GC_TRACK() to pycore_object.h #10276

< 8000 summary id="button-ef3d36521b37458d" class="btn btn-sm btn-primary m-0 ml-0 ml-md-2" > 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
wants to merge 1 commit into from
Closed

bpo-35081: Move _PyObject_GC_TRACK() to pycore_object.h #10276

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member
@vstinner vstinner commented Nov 1, 2018
  • Create Include/internal/pycore_object.h
  • Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros to
    pycore_object.h
  • Remove _PyGC_generation0: replaced with _PyRuntime.gc.generation0
  • Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack()
    in _queuemodule.c. The file is compiled without Py_BUILD_CORE.
  • Python.h now automatically includes pycore_object.h

https://bugs.python.org/issue35081

@vstinner
Copy link
Member Author
vstinner commented Nov 1, 2018

Python.h now automatically includes pycore_object.h

Without that, at least 33 C files has to be modified to add include pycore_object.h: see my first attempt, PR #10272.

I prefer to have smaller PR, easier to review. The automatic include can be removed later.

@vstinner
Copy link
Member Author
vstinner commented Nov 1, 2018

Note for myself: PR #10275 has to be updated if this PR is merged before.

* Create Include/internal/pycore_object.h
* Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros to
  pycore_object.h
* Remove _PyGC_generation0: replaced with _PyRuntime.gc.generation0
* Python.h now automatically includes pycore_object.h
@vstinner
Copy link
Member Author

PR #10507 has been merged: I rewrote and rebased this change on top of master.

@vstinner
Copy link
Member Author

I don't understand why compilation fails on AppVeyor:

c:\projects\cpython\python\pytime.c(581): error C2037: left of 'tv_sec' specifies undefined struct/union 'timeval' [C:\projects\cpython\PCbuild\pythoncore.vcxproj]

@vstinner
Copy link
Member Author

I merged PR #10640 instead.

@vstinner vstinner closed this Nov 21, 2018
@vstinner vstinner deleted the object_track2 branch November 21, 2018 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0