[commit: ghc] master: Nuke tabs in rts/posix/OSMem.c (d510f5e)

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


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

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

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

commit d510f5e4eb10131f758d6d0a912f2be91225f6c4
Author: Austin Seipp <austin at well-typed.com>
Date:   Sat Sep 14 12:35:52 2013 -0500

    Nuke tabs in rts/posix/OSMem.c
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

d510f5e4eb10131f758d6d0a912f2be91225f6c4
 rts/posix/OSMem.c |   60 ++++++++++++++++++++++++++---------------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
index b6b208e..4328d9d 100644
--- a/rts/posix/OSMem.c
+++ b/rts/posix/OSMem.c
@@ -81,13 +81,13 @@ my_mmap (void *addr, W_ size)
 
 #if defined(solaris2_HOST_OS) || defined(irix_HOST_OS)
     { 
-	int fd = open("/dev/zero",O_RDONLY);
-	ret = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
-	close(fd);
+        int fd = open("/dev/zero",O_RDONLY);
+        ret = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+        close(fd);
     }
 #elif hpux_HOST_OS
     ret = mmap(addr, size, PROT_READ | PROT_WRITE, 
-	       MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+               MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
 #elif darwin_HOST_OS
     // Without MAP_FIXED, Apple's mmap ignores addr.
     // With MAP_FIXED, it overwrites already mapped regions, whic
@@ -99,18 +99,18 @@ my_mmap (void *addr, W_ size)
     
     kern_return_t err = 0;
     ret = addr;
-    if(addr)	// try to allocate at address
-	err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, FALSE);
-    if(!addr || err)	// try to allocate anywhere
-	err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, TRUE);
+    if(addr)    // try to allocate at address
+        err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, FALSE);
+    if(!addr || err)    // try to allocate anywhere
+        err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, TRUE);
         
     if(err) {
-	// don't know what the error codes mean exactly, assume it's
-	// not our problem though.
-	errorBelch("memory allocation failed (requested %" FMT_Word " bytes)", size);
-	stg_exit(EXIT_FAILURE);
+        // don't know what the error codes mean exactly, assume it's
+        // not our problem though.
+        errorBelch("memory allocation failed (requested %" FMT_Word " bytes)", size);
+        stg_exit(EXIT_FAILURE);
     } else {
-	vm_protect(mach_task_self(),(vm_address_t)ret,size,FALSE,VM_PROT_READ|VM_PROT_WRITE);
+        vm_protect(mach_task_self(),(vm_address_t)ret,size,FALSE,VM_PROT_READ|VM_PROT_WRITE);
     }
 #elif linux_HOST_OS
     ret = mmap(addr, size, PROT_READ | PROT_WRITE,
@@ -139,15 +139,15 @@ my_mmap (void *addr, W_ size)
 #endif
 
     if (ret == (void *)-1) {
-	if (errno == ENOMEM || 
-	    (errno == EINVAL && sizeof(void*)==4 && size >= 0xc0000000)) {
-	    // If we request more than 3Gig, then we get EINVAL
-	    // instead of ENOMEM (at least on Linux).
+        if (errno == ENOMEM || 
+            (errno == EINVAL && sizeof(void*)==4 && size >= 0xc0000000)) {
+            // If we request more than 3Gig, then we get EINVAL
+            // instead of ENOMEM (at least on Linux).
             errorBelch("out of memory (requested %" FMT_Word " bytes)", size);
             stg_exit(EXIT_FAILURE);
-	} else {
-	    barf("getMBlock: mmap: %s", strerror(errno));
-	}
+        } else {
+            barf("getMBlock: mmap: %s", strerror(errno));
+        }
     }
 
     return ret;
@@ -207,17 +207,17 @@ osGetMBlocks(nat n)
       ret = my_mmap(next_request, size);
 
       if (((W_)ret & MBLOCK_MASK) != 0) {
-	  // misaligned block!
+          // misaligned block!
 #if 0 // defined(DEBUG)
-	  errorBelch("warning: getMBlock: misaligned block %p returned when allocating %d megablock(s) at %p", ret, n, next_request);
+          errorBelch("warning: getMBlock: misaligned block %p returned when allocating %d megablock(s) at %p", ret, n, next_request);
 #endif
 
-	  // unmap this block...
-	  if (munmap(ret, size) == -1) {
-	      barf("getMBlock: munmap failed");
-	  }
-	  // and do it the hard way
-	  ret = gen_map_mblocks(size);
+          // unmap this block...
+          if (munmap(ret, size) == -1) {
+              barf("getMBlock: munmap failed");
+          }
+          // and do it the hard way
+          ret = gen_map_mblocks(size);
       }
   }
   // Next time, we'll try to allocate right after the block we just got.
@@ -273,7 +273,7 @@ void setExecutable (void *p, W_ len, rtsBool exec)
     StgWord startOfLastPage  = ((StgWord)p + len - 1) & mask;
     StgWord size             = startOfLastPage - startOfFirstPage + pageSize;
     if (mprotect((void*)startOfFirstPage, (size_t)size, 
-		 (exec ? PROT_EXEC : 0) | PROT_READ | PROT_WRITE) != 0) {
-	barf("setExecutable: failed to protect 0x%p\n", p);
+                 (exec ? PROT_EXEC : 0) | PROT_READ | PROT_WRITE) != 0) {
+        barf("setExecutable: failed to protect 0x%p\n", p);
     }
 }




More information about the ghc-commits mailing list