From: Dino Viehland Date: Fri, 1 May 2026 19:56:30 +0000 (-0700) Subject: [3.14] gh-149242: Heap size should be added at end of the struct (#149241) X-Git-Tag: v3.14.5rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=312a596bcf7757e88e16a97f65ce11187a8ba7c6;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-149242: Heap size should be added at end of the struct (#149241) Co-authored-by: Neil Schemenauer --- diff --git a/Doc/data/python3.14.abi b/Doc/data/python3.14.abi index 78f380ee46d4..09ef37cf4fa4 100644 --- a/Doc/data/python3.14.abi +++ b/Doc/data/python3.14.abi @@ -1817,7 +1817,7 @@ - + @@ -21024,7 +21024,7 @@ - + @@ -21041,31 +21041,40 @@ - - - - + - + - + - + - + + + + - + + + + - + + + + + + + @@ -21507,7 +21516,7 @@ - + @@ -21556,199 +21565,199 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -22238,7 +22247,7 @@ - + diff --git a/Include/internal/pycore_interp_structs.h b/Include/internal/pycore_interp_structs.h index 972bf7bf6e80..b93d6d3c8eda 100644 --- a/Include/internal/pycore_interp_structs.h +++ b/Include/internal/pycore_interp_structs.h @@ -212,11 +212,11 @@ struct _gc_runtime_state { /* linked lists of container objects */ #ifndef Py_GIL_DISABLED struct gc_generation generations[NUM_GENERATIONS]; - PyGC_Head *generation0; #else struct gc_generation young; struct gc_generation old[2]; #endif + /* a permanent generation which won't be collected */ struct gc_generation permanent_generation; struct gc_generation_stats generation_stats[NUM_GENERATIONS]; @@ -230,6 +230,11 @@ struct _gc_runtime_state { /* The number of live objects. */ Py_ssize_t heap_size; + /* dummy members to preserve other offsets */ + Py_ssize_t dummy1; /* was work_to_do */ + int dummy2; /* was visited_space */ + int dummy3; /* was phase */ + /* This is the number of objects that survived the last full collection. It approximates the number of long lived objects tracked by the GC. @@ -255,6 +260,8 @@ struct _gc_runtime_state { /* Mutex held for gc_should_collect_mem_usage(). */ PyMutex mutex; +#else + PyGC_Head *generation0; #endif };