[commit: ghc] master: Fix getPageSize to actually cache the page size. (57700b9)

git at git.haskell.org git at git.haskell.org
Sat Sep 14 19:36:28 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/57700b9a54f81755e3760e56f3bf34426711b81c/ghc

>---------------------------------------------------------------

commit 57700b9a54f81755e3760e56f3bf34426711b81c
Author: Austin Seipp <austin at well-typed.com>
Date:   Sat Sep 14 12:20:48 2013 -0500

    Fix getPageSize to actually cache the page size.
    
    This fixes #8289.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


>---------------------------------------------------------------

57700b9a54f81755e3760e56f3bf34426711b81c
 rts/posix/OSMem.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
index 5486a15..b6b208e 100644
--- a/rts/posix/OSMem.c
+++ b/rts/posix/OSMem.c
@@ -251,14 +251,15 @@ W_ getPageSize (void)
 {
     static W_ pageSize = 0;
     if (pageSize) {
-	return pageSize;
+        return pageSize;
     } else {
-	long ret;
-	ret = sysconf(_SC_PAGESIZE);
-	if (ret == -1) {
-	    barf("getPageSize: cannot get page size");
-	}
-	return ret;
+        long ret;
+        ret = sysconf(_SC_PAGESIZE);
+        if (ret == -1) {
+           barf("getPageSize: cannot get page size");
+        }
+        pageSize = ret;
+        return ret;
     }
 }
 




More information about the ghc-commits mailing list