diff --git a/rts/sm/GCUtils.c b/rts/sm/GCUtils.c index 24f7b5e61e9e..31b2913a376c 100644 --- a/rts/sm/GCUtils.c +++ b/rts/sm/GCUtils.c @@ -81,6 +81,14 @@ freeChain_sync(bdescr *bd) RELEASE_SPIN_LOCK(&gc_alloc_block_sync); } +void +freeGroup_sync(bdescr *bd) +{ + ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync); + freeGroup(bd); + RELEASE_SPIN_LOCK(&gc_alloc_block_sync); +} + /* ----------------------------------------------------------------------------- Workspace utilities -------------------------------------------------------------------------- */ @@ -261,7 +269,7 @@ todo_block_full (uint32_t size, gen_workspace *ws) // object. However, if the object we're copying is // larger than a block, then we might have an empty // block here. - freeGroup(bd); + freeGroup_sync(bd); } else { push_scanned_block(bd, ws); } diff --git a/rts/sm/GCUtils.h b/rts/sm/GCUtils.h index 3c174491cef0..8b6040769e0d 100644 --- a/rts/sm/GCUtils.h +++ b/rts/sm/GCUtils.h @@ -31,6 +31,7 @@ INLINE_HEADER bdescr *allocBlockOnNode_sync(uint32_t node) } void freeChain_sync(bdescr *bd); +void freeGroup_sync(bdescr *bd); void push_scanned_block (bdescr *bd, gen_workspace *ws); StgPtr todo_block_full (uint32_t size, gen_workspace *ws);