File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ static class ABI
1010 // GIL builds only. FT splits the refcount; Refcount uses Py_REFCNT.
1111 public static int RefCountOffset { get ; private set ; }
1212
13- // Added to generated TypeOffsets. FT PyObject_HEAD is 16 bytes larger.
13+ // Added to generated TypeOffsets. The FT header is 12 bytes larger on
14+ // 32-bit and 16 bytes larger on 64-bit builds.
1415 public static int ObjectHeadOffset { get ; private set ; }
1516
1617 public static bool IsFreeThreaded { get ; private set ; }
@@ -19,7 +20,9 @@ internal static void Initialize(Version version)
1920 {
2021 IsFreeThreaded = DetectFreeThreaded ( ) ;
2122 RefCountOffset = IsFreeThreaded ? - 1 : ProbeRefCountOffset ( ) ;
22- ObjectHeadOffset = IsFreeThreaded ? 16 : RefCountOffset ;
23+ ObjectHeadOffset = IsFreeThreaded
24+ ? ( IntPtr . Size == 4 ? 12 : 16 )
25+ : RefCountOffset ;
2326
2427 string offsetsClassSuffix = string . Format ( CultureInfo . InvariantCulture ,
2528 "{0}{1}" , version . Major , version . Minor ) ;
You can’t perform that action at this time.
0 commit comments