summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2019-05-14 09:51:15 (GMT)
committerGitHub <noreply@github.com>2019-05-14 09:51:15 (GMT)
commitf0be4bbb9b3cee876249c23f2ae6f38f43fa7495 (patch)
tree778915b3612b9f9edbec3e2a6b1a399af3b1f6a8 /Objects
parentc923c3449f825021b13521b2380e67ba35a36f55 (diff)
downloadcpython-f0be4bbb9b3cee876249c23f2ae6f38f43fa7495.zip
cpython-f0be4bbb9b3cee876249c23f2ae6f38f43fa7495.tar.gz
cpython-f0be4bbb9b3cee876249c23f2ae6f38f43fa7495.tar.bz2
bpo-27987: pymalloc: align by 16bytes on 64bit platform (GH-12850)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/obmalloc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 7cfd289..bd15bcf 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -795,8 +795,14 @@ static int running_on_valgrind = -1;
*
* You shouldn't change this unless you know what you are doing.
*/
+
+#if SIZEOF_VOID_P > 4
+#define ALIGNMENT 16 /* must be 2^N */
+#define ALIGNMENT_SHIFT 4
+#else
#define ALIGNMENT 8 /* must be 2^N */
#define ALIGNMENT_SHIFT 3
+#endif
/* Return the number of bytes in size class I, as a uint. */
#define INDEX2SIZE(I) (((uint)(I) + 1) << ALIGNMENT_SHIFT)