bpo-42197: Disable automatic update of frame locals during profiling … · python/cpython@50fe523 · GitHub
Skip to content

Commit 50fe523

Browse files
committed
bpo-42197: Disable automatic update of frame locals during profiling and tracing
1 parent a44ce6c commit 50fe523

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

Doc/library/sys.rst

Lines changed: 11 additions & 0 deletions

Doc/whatsnew/3.10.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ Optimizations
417417
bytecode level. It is now around 100% faster to create a function with parameter
418418
annotations. (Contributed by Yurii Karabas and Inada Naoki in :issue:`42202`)
419419

420+
* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
421+
(Contributed by Fabio Zadrozny in :issue:`issue42197`)
422+
420423
Deprecated
421424
==========
422425

@@ -656,6 +659,12 @@ Porting to Python 3.10
656659
bugs like ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` test.
657660
(Contributed by Zackery Spytz and Victor Stinner in :issue:`30459`.)
658661

662+
* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer
663+
called before and after the trace or profile function, so, they must now
664+
be explicitly called when manipulating `PyFrameObject.f_locals`.
665+
(Contributed by Fabio Zadrozny in :issue:`issue42197`)
666+
667+
659668
Deprecated
660669
----------
661670

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
`PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer
2+
called during profile nor tracing. To inspect the `PyFrameObject.f_locals` member,
3+
debuggers and profilers implemented in C must now call `PyFrame_FastToLocalsWithError`
4+
to update locals and `PyFrame_LocalsToFast` after `PyFrameObject.f_locals` are updated.

Python/sysmodule.c

Lines changed: 0 additions & 5 deletions

0 commit comments

Comments
 (0)