Skip to content

Instantly share code, notes, and snippets.

@maman
Created July 30, 2021 12:54
Show Gist options
  • Save maman/93f2e09e008448563845f76720249b1d to your computer and use it in GitHub Desktop.
Save maman/93f2e09e008448563845f76720249b1d to your computer and use it in GitHub Desktop.
--- Include/objimpl.h
+++ Include/objimpl.h
@@ -250,7 +250,7 @@
union _gc_head *gc_prev;
Py_ssize_t gc_refs;
} gc;
- double dummy; /* force worst-case alignment */
+ long double dummy; /* force worst-case alignment */
} PyGC_Head;
extern PyGC_Head *_PyGC_generation0;
--- Objects/obmalloc.c
+++ Objects/obmalloc.c
@@ -643,8 +643,8 @@
*
* You shouldn't change this unless you know what you are doing.
*/
-#define ALIGNMENT 8 /* must be 2^N */
-#define ALIGNMENT_SHIFT 3
+#define ALIGNMENT 16 /* must be 2^N */
+#define ALIGNMENT_SHIFT 4
/* Return the number of bytes in size class I, as a uint. */
#define INDEX2SIZE(I) (((uint)(I) + 1) << ALIGNMENT_SHIFT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment