Skip to content

Commit 09360cc

Browse files
committed
GC pointer must be aligned by 8bytes
1 parent 07329a8 commit 09360cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/gcmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@ _PyObject_GC_Alloc(int use_calloc, size_t basicsize)
17861786
g = (PyGC_Head *)PyObject_Malloc(size);
17871787
if (g == NULL)
17881788
return PyErr_NoMemory();
1789+
assert(((uintptr_t)g & 7) == 0); // g must be aligned 8bytes boundary
17891790
g->gc.gc_next = NULL;
17901791
g->gc.gc_prev = 0;
17911792
_PyRuntime.gc.generations[0].count++; /* number of allocated GC objects */

0 commit comments

Comments
 (0)