Commit 43df2a2
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 45d8129 commit 43df2a2
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 | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
635 | | - | |
| 635 | + | |
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| |||
1867 | 1867 | | |
1868 | 1868 | | |
1869 | 1869 | | |
1870 | | - | |
| 1870 | + | |
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
| |||
0 commit comments