mirror of
https://github.com/python/cpython.git
synced 2026-03-17 02:10:56 +00:00
GH-127953: Make line number lookup O(1) regardless of the size of the code object (GH-128350)
This commit is contained in:
parent
f7cc7d296c
commit
7239da7559
6 changed files with 214 additions and 163 deletions
|
|
@ -35,11 +35,12 @@ typedef struct {
|
|||
} _PyCoCached;
|
||||
|
||||
/* Ancillary data structure used for instrumentation.
|
||||
Line instrumentation creates an array of
|
||||
these. One entry per code unit.*/
|
||||
Line instrumentation creates this with sufficient
|
||||
space for one entry per code unit. The total size
|
||||
of the data will be `bytes_per_entry * Py_SIZE(code)` */
|
||||
typedef struct {
|
||||
uint8_t original_opcode;
|
||||
int8_t line_delta;
|
||||
uint8_t bytes_per_entry;
|
||||
uint8_t data[1];
|
||||
} _PyCoLineInstrumentationData;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue