Bug 801295 - mincore() call has incorrect type on tier3 (non-Linux). r=jlebar
authorJan Beich <jbeich@tormail.org>
Sat, 13 Oct 2012 09:34:00 -0400
changeset 110295 34b1f3ed81136a0810d2f936b78ec75d9df50e2f
parent 110294 9d5627f5882bea4e60bdc44ad3bf157c42ccbdd5
child 110296 b8e7df7ac70f75b1564a5c25cf4cda1f2d71f5bb
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjlebar
bugs801295
milestone19.0a1
Bug 801295 - mincore() call has incorrect type on tier3 (non-Linux). r=jlebar
js/src/vm/Stack.cpp
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -822,22 +822,21 @@ StackSpace::sizeOf()
      * which are swapped out to disk.  We really should, but what we have here
      * is better than counting the whole stack!
      */
 
     const int pageSize = getpagesize();
     size_t numBytes = (trustedEnd_ - base_) * sizeof(Value);
     size_t numPages = (numBytes + pageSize - 1) / pageSize;
 
-    // On Linux, mincore's third argument has type unsigned char*.  On Mac, it
-    // has type char*.
-#if defined(XP_MACOSX)
+    // On Linux, mincore's third argument has type unsigned char*.
+#ifdef __linux__
+    typedef unsigned char MincoreArgType;
+#else
     typedef char MincoreArgType;
-#else
-    typedef unsigned char MincoreArgType;
 #endif
 
     MincoreArgType *vec = (MincoreArgType *) js_malloc(numPages);
     int result = mincore(base_, numBytes, vec);
     if (result) {
         js_free(vec);
         /*
          * If mincore fails us, return the vsize (like we do below if we're not