Fix caching of pagesize
authorSimon Marlow <marlowsd@gmail.com>
Wed, 21 Oct 2015 09:42:57 +0000 (10:42 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 21 Oct 2015 13:05:09 +0000 (14:05 +0100)
Summary: Spotted by @erikd

Test Plan: validate

Reviewers: austin, bgamari, erikd

Subscribers: thomie, erikd

Differential Revision: https://phabricator.haskell.org/D1345

rts/Linker.c

index 8e5ffa1..c40af2f 100644 (file)
@@ -2233,10 +2233,9 @@ static StgWord getPageSize(void)
 {
     static StgWord pagesize = 0;
     if (pagesize == 0) {
-        return sysconf(_SC_PAGESIZE);
-    } else {
-        return pagesize;
+        pagesize = sysconf(_SC_PAGESIZE);
     }
+    return pagesize;
 }
 
 static StgWord roundUpToPage (StgWord size)