Skip to content

Commit f74096b

Browse files
committed
add comment
1 parent 9c91e86 commit f74096b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Include/internal/pycore_optimizer_types.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ typedef struct {
9696
uint8_t tag;
9797
} JitOptCompactInt;
9898

99+
// Mapping from slot index or attribute offset to its symbolic value.
100+
// SAFETY: This structure is used for both STORE_ATTR_SLOT
101+
// and STORE_ATTR_INSTANCE_VALUE.
102+
// These two never appear on the same object type because:
103+
// __slots__ classes don't have Py_TPFLAGS_INLINE_VALUES
104+
// Therefore, there is no index collision between
105+
// slot offsets and inline value offsets.
106+
// Note: STORE_ATTR_WITH_HINT is NOT currently tracked.
107+
// If we want to track it in the future, we need to
108+
// be careful about potential index collisions with STORE_ATTR_INSTANCE_VALUE.
99109
typedef struct {
100110
uint16_t slot_index;
101111
uint16_t symbol;

0 commit comments

Comments
 (0)