mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-115776: Allow any fixed sized object to have inline values (GH-123192)
This commit is contained in:
parent
4b7c4880a0
commit
a4fd7aa4a6
13 changed files with 61 additions and 38 deletions
|
@ -69,9 +69,6 @@ def _type_unsigned_int_ptr():
|
|||
def _sizeof_void_p():
|
||||
return gdb.lookup_type('void').pointer().sizeof
|
||||
|
||||
def _sizeof_pyobject():
|
||||
return gdb.lookup_type('PyObject').sizeof
|
||||
|
||||
def _managed_dict_offset():
|
||||
# See pycore_object.h
|
||||
pyobj = gdb.lookup_type("PyObject")
|
||||
|
@ -505,7 +502,7 @@ class HeapTypeObjectPtr(PyObjectPtr):
|
|||
dict_ptr = dict_ptr_ptr.cast(_type_char_ptr().pointer()).dereference()
|
||||
if int(dict_ptr):
|
||||
return None
|
||||
char_ptr = obj_ptr + _sizeof_pyobject()
|
||||
char_ptr = obj_ptr + typeobj.field('tp_basicsize')
|
||||
values_ptr = char_ptr.cast(gdb.lookup_type("PyDictValues").pointer())
|
||||
values = values_ptr['values']
|
||||
return PyKeysValuesPair(self.get_cached_keys(), values)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue