-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-131253: free-threaded build support for pystats #137189
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1c194e2
gh-131253: free-threaded build support for pystats
nascheme 7dc9191
Make pystats global state be per-interpreter.
nascheme 60454a2
Add NEWS.
nascheme df1c5d4
Merge 'origin/main' into gh-131253-pystats-ft
nascheme c94e5c4
Fix some data race issues.
nascheme e77af2c
Remove _Py_tss_stats thread local.
nascheme 488f0be
Merge 'origin/main' into gh-131253-pystats-ft
nascheme a48c7f6
Improve _Py_STATS_COND_EXPR macro.
nascheme 612ea96
Improve comment for ts->pystats member.
nascheme 0e09267
Cleanup init of interp->pystats_struct.
nascheme a3cfb7e
Split stats zeroing into separate functions.
nascheme 724b086
Merge 'origin/main' into gh-131253-pystats-ft
nascheme bef1bcb
Fix a couple bugs related to stats allocation.
nascheme 5034375
Add unit test for pystats.
nascheme af9d886
Merge 'origin/main' into gh-131253-pystats-ft
nascheme 09011fe
Typo fix for Lib/test/test_pystats.py
nascheme 1e5db7a
Typo fix for comment in Include/cpython/pystate.h
nascheme 873d915
Code style tweaks.
nascheme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Cleanup init of interp->pystats_struct.
Add the _PyStats_InterpInit() function which will set pystats_enabled flag and allocate pystats_struct as required. We shouldn't be putting logic in _PyObject_InitState(). This also fixes a bug where interp->pystats_struct was allocated repeated rather than once per interpreter.
- Loading branch information
commit 0e0926777488d48e8b96101a2664fe4fa84be41d
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, we use
PyMem_RawCallocto allocate new interp memory. Then the default value ofinterp->pystats_enabledis 0, so ifinterp->config._pystatsis false, we don't need to initialize it.