[commit: ghc] master: rts: delint/detab/dewhitespace Arena.c (4f5966b)

git at git.haskell.org git at git.haskell.org
Mon Jul 28 14:36:30 UTC 2014


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

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

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

commit 4f5966b3edd62997552d2ebe371542861ed81405
Author: Austin Seipp <austin at well-typed.com>
Date:   Mon Jul 21 20:21:54 2014 -0500

    rts: delint/detab/dewhitespace Arena.c
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

4f5966b3edd62997552d2ebe371542861ed81405
 rts/Arena.c | 47 +++++++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/rts/Arena.c b/rts/Arena.c
index 361c6c4..813e60e 100644
--- a/rts/Arena.c
+++ b/rts/Arena.c
@@ -27,8 +27,8 @@
 // Each arena struct is allocated using malloc().
 struct _Arena {
     bdescr *current;
-    StgWord *free;		// ptr to next free byte in current block
-    StgWord *lim;		// limit (== last free byte + 1)
+    StgWord *free;              // ptr to next free byte in current block
+    StgWord *lim;               // limit (== last free byte + 1)
 };
 
 // We like to keep track of how many blocks we've allocated for
@@ -74,26 +74,26 @@ arenaAlloc( Arena *arena, size_t size )
     size_w = B_TO_W(size);
 
     if ( arena->free + size_w < arena->lim ) {
-	// enough room in the current block...
-	p = arena->free;
-	arena->free += size_w;
-	return p;
+        // enough room in the current block...
+        p = arena->free;
+        arena->free += size_w;
+        return p;
     } else {
-	// allocate a fresh block...
-	req_blocks =  (W_)BLOCK_ROUND_UP(size) / BLOCK_SIZE;
-	bd = allocGroup_lock(req_blocks);
-	arena_blocks += req_blocks;
+        // allocate a fresh block...
+        req_blocks =  (W_)BLOCK_ROUND_UP(size) / BLOCK_SIZE;
+        bd = allocGroup_lock(req_blocks);
+        arena_blocks += req_blocks;
 
-	bd->gen_no  = 0;
-	bd->gen     = NULL;
+        bd->gen_no  = 0;
+        bd->gen     = NULL;
         bd->dest_no = 0;
-	bd->flags   = 0;
-	bd->free    = bd->start;
-	bd->link    = arena->current;
-	arena->current = bd;
-	arena->free = bd->free + size_w;
-	arena->lim = bd->free + bd->blocks * BLOCK_SIZE_W;
-	return bd->start;
+        bd->flags   = 0;
+        bd->free    = bd->start;
+        bd->link    = arena->current;
+        arena->current = bd;
+        arena->free = bd->free + size_w;
+        arena->lim = bd->free + bd->blocks * BLOCK_SIZE_W;
+        return bd->start;
     }
 }
 
@@ -104,10 +104,10 @@ arenaFree( Arena *arena )
     bdescr *bd, *next;
 
     for (bd = arena->current; bd != NULL; bd = next) {
-	next = bd->link;
-	arena_blocks -= bd->blocks;
-	ASSERT(arena_blocks >= 0);
-	freeGroup_lock(bd);
+        next = bd->link;
+        arena_blocks -= bd->blocks;
+        ASSERT(arena_blocks >= 0);
+        freeGroup_lock(bd);
     }
     stgFree(arena);
 }
@@ -117,4 +117,3 @@ arenaBlocks( void )
 {
     return arena_blocks;
 }
-



More information about the ghc-commits mailing list