diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2020-04-10 02:40:32 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-01 06:32:56 -0400 |
commit | 2ee4f36c779674f7237d730460ca83aec9a6808a (patch) | |
tree | 117b74a6664904f97f07d4f9f370db23bb13dd64 /rts | |
parent | 6947231abd8c33840860ad51699b76efd4725f0e (diff) | |
download | haskell-2ee4f36c779674f7237d730460ca83aec9a6808a.tar.gz |
Cleanup OVERWRITING_CLOSURE logic
The code is just more confusing than it needs to be. We don't need to mix
the threaded check with the ldv profiling check since ldv's init already
checks for this. Hence they can be two separate checks. Taking the sanity
checking into account is also cleaner via DebugFlags.sanity. No need for
checking the DEBUG define.
The ZERO_SLOP_FOR_LDV_PROF and ZERO_SLOP_FOR_SANITY_CHECK definitions the
old code had also make things a lot more opaque IMO so I removed those.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/PrimOps.cmm | 12 | ||||
-rw-r--r-- | rts/sm/Storage.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 048cde8065..090f915035 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -175,8 +175,8 @@ stg_shrinkMutableByteArrayzh ( gcptr mba, W_ new_size ) { ASSERT(new_size <= StgArrBytes_bytes(mba)); - OVERWRITING_CLOSURE_OFS(mba, (BYTES_TO_WDS(SIZEOF_StgArrBytes) + - ROUNDUP_BYTES_TO_WDS(new_size))); + OVERWRITING_CLOSURE_MUTABLE(mba, (BYTES_TO_WDS(SIZEOF_StgArrBytes) + + ROUNDUP_BYTES_TO_WDS(new_size))); StgArrBytes_bytes(mba) = new_size; // No need to call LDV_RECORD_CREATE. See Note [LDV profiling and resizing arrays] @@ -199,8 +199,8 @@ stg_resizzeMutableByteArrayzh ( gcptr mba, W_ new_size ) new_size_wds = ROUNDUP_BYTES_TO_WDS(new_size); if (new_size_wds <= BYTE_ARR_WDS(mba)) { - OVERWRITING_CLOSURE_OFS(mba, (BYTES_TO_WDS(SIZEOF_StgArrBytes) + - new_size_wds)); + OVERWRITING_CLOSURE_MUTABLE(mba, (BYTES_TO_WDS(SIZEOF_StgArrBytes) + + new_size_wds)); StgArrBytes_bytes(mba) = new_size; // No need to call LDV_RECORD_CREATE. See Note [LDV profiling and resizing arrays] @@ -228,8 +228,8 @@ stg_shrinkSmallMutableArrayzh ( gcptr mba, W_ new_size ) { ASSERT(new_size <= StgSmallMutArrPtrs_ptrs(mba)); - OVERWRITING_CLOSURE_OFS(mba, (BYTES_TO_WDS(SIZEOF_StgSmallMutArrPtrs) + - new_size)); + OVERWRITING_CLOSURE_MUTABLE(mba, (BYTES_TO_WDS(SIZEOF_StgSmallMutArrPtrs) + + new_size)); StgSmallMutArrPtrs_ptrs(mba) = new_size; // No need to call LDV_RECORD_CREATE. See Note [LDV profiling and resizing arrays] diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index a73228dce6..b47afaf7df 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -948,7 +948,7 @@ accountAllocation(Capability *cap, W_ n) * * When profiling we zero: * - Pinned object alignment slop, see MEMSET_IF_PROFILING_W in allocatePinned. - * - Shrunk array slop, see OVERWRITING_MUTABLE_CLOSURE. + * - Shrunk array slop, see OVERWRITING_CLOSURE_MUTABLE. * * When performing LDV profiling or using a (single threaded) debug RTS we zero * slop even when overwriting immutable closures, see Note [zeroing slop when |