diff options
author | Mark Shannon <mark@hotpy.org> | 2022-03-25 12:57:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 12:57:50 (GMT) |
commit | d7163bb35d1ed46bde9affcd4eb267dfd0b703dd (patch) | |
tree | 50ced5b75c3e1579c4e23fd7c404ac33c53b7fc3 /Misc | |
parent | b68431fadb3150134ac6ccbf501cdfeaf4c75678 (diff) | |
download | cpython-d7163bb35d1ed46bde9affcd4eb267dfd0b703dd.zip cpython-d7163bb35d1ed46bde9affcd4eb267dfd0b703dd.tar.gz cpython-d7163bb35d1ed46bde9affcd4eb267dfd0b703dd.tar.bz2 |
bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055)
* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
(Contributed by Fabio Zadrozny)
* Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`.
* Document new `PyFrame_GetLocals` C-API function.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2022-03-22-15-12-28.bpo-42197.SwrrFO.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-03-22-15-12-28.bpo-42197.SwrrFO.rst b/Misc/NEWS.d/next/Core and Builtins/2022-03-22-15-12-28.bpo-42197.SwrrFO.rst new file mode 100644 index 0000000..d54002a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-03-22-15-12-28.bpo-42197.SwrrFO.rst @@ -0,0 +1,2 @@ +:c:func:`PyFrame_FastToLocalsWithError` and :c:func:`PyFrame_LocalsToFast` are no longer +called during profiling nor tracing. C code can access the ``f_locals`` attribute of :c:type:`PyFrameObject` by calling :c:func:`PyFrame_GetLocals`. |