[commit: ghc] master: rts: Fix "ASSERT ("s (1d66f10)
git at git.haskell.org
git at git.haskell.org
Sun Apr 23 15:06:28 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/1d66f1051933ca3dedbf04da9ce38687dbfd8f05/ghc
>---------------------------------------------------------------
commit 1d66f1051933ca3dedbf04da9ce38687dbfd8f05
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Sun Apr 23 10:00:19 2017 -0400
rts: Fix "ASSERT ("s
Reviewers: austin, erikd, simonmar
Reviewed By: erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3486
>---------------------------------------------------------------
1d66f1051933ca3dedbf04da9ce38687dbfd8f05
rts/Compact.cmm | 8 ++++----
rts/sm/CNF.c | 22 +++++++++++-----------
rts/sm/CNF.h | 4 ++--
rts/sm/Sanity.c | 10 +++++-----
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/rts/Compact.cmm b/rts/Compact.cmm
index 0b98f39..5290d95 100644
--- a/rts/Compact.cmm
+++ b/rts/Compact.cmm
@@ -358,7 +358,7 @@ stg_compactGetFirstBlockzh ( P_ str )
W_ size;
block = str - SIZEOF_StgCompactNFDataBlock::W_;
- ASSERT (StgCompactNFDataBlock_owner(block) == str);
+ ASSERT(StgCompactNFDataBlock_owner(block) == str);
// We have to save Hp back to the nursery, otherwise the size will
// be wrong.
@@ -367,7 +367,7 @@ stg_compactGetFirstBlockzh ( P_ str )
bd = Bdescr(str);
size = bdescr_free(bd) - bdescr_start(bd);
- ASSERT (size <= TO_W_(bdescr_blocks(bd)) * BLOCK_SIZE);
+ ASSERT(size <= TO_W_(bdescr_blocks(bd)) * BLOCK_SIZE);
return (block, size);
}
@@ -396,12 +396,12 @@ stg_compactGetNextBlockzh ( P_ str, W_ block )
return (0::W_, 0::W_);
}
- ASSERT (StgCompactNFDataBlock_owner(next_block) == str ||
+ ASSERT(StgCompactNFDataBlock_owner(next_block) == str ||
StgCompactNFDataBlock_owner(next_block) == NULL);
bd = Bdescr(next_block);
size = bdescr_free(bd) - bdescr_start(bd);
- ASSERT (size <= TO_W_(bdescr_blocks(bd)) * BLOCK_SIZE);
+ ASSERT(size <= TO_W_(bdescr_blocks(bd)) * BLOCK_SIZE);
return (next_block, size);
}
diff --git a/rts/sm/CNF.c b/rts/sm/CNF.c
index ed9460e..b81fd2b 100644
--- a/rts/sm/CNF.c
+++ b/rts/sm/CNF.c
@@ -203,8 +203,8 @@ compactAllocateBlockInternal(Capability *cap,
block = allocGroup(n_blocks);
switch (operation) {
case ALLOCATE_NEW:
- ASSERT (first == NULL);
- ASSERT (g == g0);
+ ASSERT(first == NULL);
+ ASSERT(g == g0);
dbl_link_onto(block, &g0->compact_objects);
g->n_compact_blocks += block->blocks;
g->n_new_large_words += aligned_size / sizeof(StgWord);
@@ -214,8 +214,8 @@ compactAllocateBlockInternal(Capability *cap,
dbl_link_onto(block, &g0->compact_blocks_in_import);
/* fallthrough */
case ALLOCATE_IMPORT_APPEND:
- ASSERT (first == NULL);
- ASSERT (g == g0);
+ ASSERT(first == NULL);
+ ASSERT(g == g0);
g->n_compact_blocks_in_import += block->blocks;
g->n_new_large_words += aligned_size / sizeof(StgWord);
break;
@@ -307,7 +307,7 @@ countCompactBlocks(bdescr *outer)
block = (StgCompactNFDataBlock*)(outer->start);
do {
inner = Bdescr((P_)block);
- ASSERT (inner->flags & BF_COMPACT);
+ ASSERT(inner->flags & BF_COMPACT);
count += inner->blocks;
block = block->next;
@@ -335,7 +335,7 @@ countAllocdCompactBlocks(bdescr *outer)
block = (StgCompactNFDataBlock*)(outer->start);
do {
inner = Bdescr((P_)block);
- ASSERT (inner->flags & BF_COMPACT);
+ ASSERT(inner->flags & BF_COMPACT);
count += inner->blocks;
// See BlockAlloc.c:countAllocdBlocks()
@@ -407,13 +407,13 @@ compactAppendBlock (Capability *cap,
block->owner = str;
block->next = NULL;
- ASSERT (str->last->next == NULL);
+ ASSERT(str->last->next == NULL);
str->last->next = block;
str->last = block;
bd = Bdescr((P_)block);
bd->free = (StgPtr)((W_)block + sizeof(StgCompactNFDataBlock));
- ASSERT (bd->free == (StgPtr)block + sizeofW(StgCompactNFDataBlock));
+ ASSERT(bd->free == (StgPtr)block + sizeofW(StgCompactNFDataBlock));
str->totalW += bd->blocks * BLOCK_SIZE_W;
@@ -920,7 +920,7 @@ fixup_block(StgCompactNFDataBlock *block, StgWord *fixup_table, uint32_t count)
bd = Bdescr((P_)block);
p = bd->start + sizeofW(StgCompactNFDataBlock);
while (p < bd->free) {
- ASSERT (LOOKS_LIKE_CLOSURE_PTR(p));
+ ASSERT(LOOKS_LIKE_CLOSURE_PTR(p));
info = get_itbl((StgClosure*)p);
switch (info->type) {
@@ -1163,8 +1163,8 @@ compactFixupPointers(StgCompactNFData *str,
total_blocks = str->totalW / BLOCK_SIZE_W;
ACQUIRE_SM_LOCK;
- ASSERT (bd->gen == g0);
- ASSERT (g0->n_compact_blocks_in_import >= total_blocks);
+ ASSERT(bd->gen == g0);
+ ASSERT(g0->n_compact_blocks_in_import >= total_blocks);
g0->n_compact_blocks_in_import -= total_blocks;
g0->n_compact_blocks += total_blocks;
dbl_link_remove(bd, &g0->compact_blocks_in_import);
diff --git a/rts/sm/CNF.h b/rts/sm/CNF.h
index a01c153..c4655dc 100644
--- a/rts/sm/CNF.h
+++ b/rts/sm/CNF.h
@@ -48,14 +48,14 @@ INLINE_HEADER StgCompactNFDataBlock *objectGetCompactBlock (StgClosure *closure)
object_block = Bdescr((StgPtr)closure);
- ASSERT ((object_block->flags & BF_COMPACT) != 0);
+ ASSERT((object_block->flags & BF_COMPACT) != 0);
if (object_block->blocks == 0)
head_block = object_block->link;
else
head_block = object_block;
- ASSERT ((head_block->flags & BF_COMPACT) != 0);
+ ASSERT((head_block->flags & BF_COMPACT) != 0);
return (StgCompactNFDataBlock*)(head_block->start);
}
diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c
index 625b12e..2b91540 100644
--- a/rts/sm/Sanity.c
+++ b/rts/sm/Sanity.c
@@ -484,22 +484,22 @@ checkCompactObjects(bdescr *bd)
StgCompactNFData *str;
StgWord totalW;
- ASSERT (bd->flags & BF_COMPACT);
+ ASSERT(bd->flags & BF_COMPACT);
block = (StgCompactNFDataBlock*)bd->start;
str = block->owner;
- ASSERT ((W_)str == (W_)block + sizeof(StgCompactNFDataBlock));
+ ASSERT((W_)str == (W_)block + sizeof(StgCompactNFDataBlock));
totalW = 0;
for ( ; block ; block = block->next) {
last = block;
- ASSERT (block->owner == str);
+ ASSERT(block->owner == str);
totalW += Bdescr((P_)block)->blocks * BLOCK_SIZE_W;
}
- ASSERT (str->totalW == totalW);
- ASSERT (str->last == last);
+ ASSERT(str->totalW == totalW);
+ ASSERT(str->last == last);
}
}
More information about the ghc-commits
mailing list