Commit 28cc5f5
committed
Separate WeakRefList from ObjExt as independent prefix
Split the monolithic ObjExt prefix into two independent prefixes:
- ObjExt: dict + member slots (allocated when HAS_DICT or member_count > 0)
- WeakRefList: weakref support (allocated when HAS_WEAKREF)
Layout: [ObjExt?][WeakRefList?][PyInner<T>]
WeakRefList is always at a fixed offset (WEAKREF_OFFSET) before PyInner.
ObjExt offset varies based on whether WeakRefList is also present.
Add MANAGED_WEAKREF flag (1 << 3) matching CPython's Py_TPFLAGS_MANAGED_WEAKREF.1 parent 46abff6 commit 28cc5f5
File tree
4 files changed
+159
-65
lines changed- crates/vm/src
- builtins
- object
- types
4 files changed
+159
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
| 600 | + | |
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| |||
1989 | 1989 | | |
1990 | 1990 | | |
1991 | 1991 | | |
1992 | | - | |
| 1992 | + | |
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
| |||
0 commit comments