mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
bpo-44032: Move data stack to thread from FrameObject. (GH-26076)
* Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames. * Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells. * Move locals, cells and freevars out of frame object into separate memory buffer. * Use per-threadstate allocated memory chunks for local variables. * Move globals and builtins from frame object to per-thread stack. * Move (slow) locals frame object to per-thread stack. * Move internal frame functions to internal header.
This commit is contained in:
parent
be4dd7fcd9
commit
b11a951f16
20 changed files with 454 additions and 250 deletions
|
@ -1274,11 +1274,7 @@ class SizeofTest(unittest.TestCase):
|
|||
# frame
|
||||
import inspect
|
||||
x = inspect.currentframe()
|
||||
ncells = len(x.f_code.co_cellvars)
|
||||
nfrees = len(x.f_code.co_freevars)
|
||||
localsplus = x.f_code.co_stacksize + x.f_code.co_nlocals +\
|
||||
ncells + nfrees
|
||||
check(x, vsize('8P3i3c' + localsplus*'P'))
|
||||
check(x, size('5P3i4cP'))
|
||||
# function
|
||||
def func(): pass
|
||||
check(func, size('14P'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue