Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19620c5

Browse files
committed
gdb/libpython.py: inline _type_void_ptr()
The function was only called in _sizeof_void_p()
1 parent d7a7122 commit 19620c5

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

Tools/gdb/libpython.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
# Those need to be refreshed as types (pointer sizes) may change when
6060
# gdb loads different executables
6161

62-
6362
def _type_char_ptr():
6463
return gdb.lookup_type('char').pointer() # char*
6564

@@ -68,27 +67,22 @@ def _type_unsigned_char_ptr():
6867
return gdb.lookup_type('unsigned char').pointer() # unsigned char*
6968

7069

71-
def _type_void_ptr():
72-
return gdb.lookup_type('void').pointer() # void*
73-
74-
7570
def _type_unsigned_short_ptr():
7671
return gdb.lookup_type('unsigned short').pointer()
7772

7873

7974
def _type_unsigned_int_ptr():
8075
return gdb.lookup_type('unsigned int').pointer()
8176

82-
# value computed later, see PyUnicodeObjectPtr.proxy()
83-
_is_pep393 = None
84-
8577

8678
def _sizeof_void_p():
87-
return _type_void_ptr().sizeof
79+
return gdb.lookup_type('void').pointer().sizeof
8880

8981

90-
Py_TPFLAGS_HEAPTYPE = (1 << 9)
82+
# value computed later, see PyUnicodeObjectPtr.proxy()
83+
_is_pep393 = None
9184

85+
Py_TPFLAGS_HEAPTYPE = (1 << 9)
9286
Py_TPFLAGS_LONG_SUBCLASS = (1 << 24)
9387
Py_TPFLAGS_LIST_SUBCLASS = (1 << 25)
9488
Py_TPFLAGS_TUPLE_SUBCLASS = (1 << 26)

0 commit comments

Comments
 (0)