align to max_align_t
*/
+#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include "config.h"
#include "types.h"
-#define ALLOC_ALIGN_SIZE (sizeof(void*))
+#if __STDC_VERSION__ < 201112L
+// use this hack if not C11
+typedef struct { long long __ll; long double __ld; } max_align_t;
+#endif
+
+#define ALLOC_ALIGN_SIZE (_Alignof(max_align_t))
#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
