Skip to content

Commit 57fb4bf

Browse files
committed
Compute payload offsets from the merged Py header
`PyInner` is now `Py`, so the payload offset and the dict member offset are measured from `Py<T>`. Assisted-by: Claude:claude-opus-5-5
1 parent 39a7284 commit 57fb4bf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/vm/src/object/core.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,13 @@ pub const SIZEOF_PYOBJECT_HEAD: usize = core::mem::size_of::<Py<()>>();
476476
#[must_use]
477477
#[inline]
478478
pub const fn payload_offset<T>() -> usize {
479-
core::mem::offset_of!(PyInner<T>, payload)
479+
core::mem::offset_of!(Py<T>, payload)
480480
}
481481

482-
/// Byte offset of the instance-dict pointer from the start of `PyInner`.
482+
/// Byte offset of the instance-dict pointer from the start of `Py`.
483483
///
484484
/// The pointer is the first field of `ObjExt`, which sits immediately in front
485-
/// of `PyInner`. The cell owns the dict.
485+
/// of `Py`. The cell owns the dict.
486486
#[must_use]
487487
#[inline]
488488
pub const fn dict_member_offset() -> isize {

0 commit comments

Comments
 (0)