From 0e2f3d101521453db8c9fdbfea881982037cce27 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 29 Aug 2018 10:59:37 -0400 Subject: [PATCH] sanity check page size at runtime --- malloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/malloc.c b/malloc.c index 1506786..e7dc26a 100644 --- a/malloc.c +++ b/malloc.c @@ -594,6 +594,10 @@ COLD static void init_slow_path(void) { fatal_error("pthread_atfork failed"); } + if (sysconf(_SC_PAGESIZE) != PAGE_SIZE) { + fatal_error("page size mismatch"); + } + struct random_state rng; random_state_init(&rng);