Skip to content
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

gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists #114899

Merged
merged 14 commits into from
Feb 10, 2024

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Feb 2, 2024

@corona10 corona10 changed the title gh-111968: Refactor _PyXXX_Fini to follow Eric's suggestion gh-111968: Refactor _PyXXX_Fini to use _PyObject_ClearFreeLists Feb 2, 2024
@corona10
Copy link
Member Author

corona10 commented Feb 2, 2024

Addressed by @ericsnowcurrently 's and @colesbury 's review from #111968 (comment)

@corona10 corona10 changed the title gh-111968: Refactor _PyXXX_Fini to use _PyObject_ClearFreeLists gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists Feb 2, 2024
Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, although I'd probably name PySlice_ClearCache like the other freelist clearing functions for consistency.

Include/internal/pycore_gc.h Outdated Show resolved Hide resolved
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. It mostly looks okay to me. There are just a few small things I'd like you to consider.

Python/pystate.c Outdated Show resolved Hide resolved
Python/pystate.c Outdated Show resolved Hide resolved
Include/internal/pycore_gc.h Outdated Show resolved Hide resolved
@bedevere-app
Copy link

bedevere-app bot commented Feb 2, 2024

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be put in the comfy chair!

@@ -125,6 +125,16 @@ typedef struct _Py_freelist_state {
struct _Py_object_stack_state object_stacks;
} _PyFreeListState;

extern void _PyObject_ClearFreeLists(_PyFreeListState *state, int is_finalization);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this API is not a domain-specific API, I located all ClearFreeList API into here :)

@corona10 corona10 changed the title gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists [WIP] gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists Feb 3, 2024
@corona10 corona10 changed the title [WIP] gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists Feb 3, 2024
@corona10
Copy link
Member Author

corona10 commented Feb 3, 2024

I have made the requested changes; please review again

@corona10
Copy link
Member Author

corona10 commented Feb 3, 2024

As I commented before, we need some header cleanup, but I will do it as a separate PR since it affected a lot of codes, including bytecodes.c

@corona10
Copy link
Member Author

corona10 commented Feb 8, 2024

@ericsnowcurrently gentle ping

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@corona10 corona10 enabled auto-merge (squash) February 10, 2024 00:42
@corona10 corona10 merged commit d4d5bae into python:main Feb 10, 2024
33 checks passed
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
@corona10 corona10 deleted the gh-111968-fini branch February 15, 2024 01:41
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