Skip to content
Snippets Groups Projects
Commit 813c5219 authored by GHC GitLab CI's avatar GHC GitLab CI
Browse files

nonmoving: Add missing write barrier in shrinkSmallByteArray

(cherry picked from commit 35c22991)
parent 38f2f627
No related branches found
No related tags found
No related merge requests found
......@@ -233,6 +233,22 @@ stg_shrinkSmallMutableArrayzh ( gcptr mba, W_ new_size )
OVERWRITING_CLOSURE_OFS(mba, (BYTES_TO_WDS(SIZEOF_StgSmallMutArrPtrs) +
new_size));
IF_NONMOVING_WRITE_BARRIER_ENABLED {
// Ensure that the elements we are about to shrink out of existence
// remain visible to the non-moving collector.
W_ p, end;
p = mba + SIZEOF_StgSmallMutArrPtrs + WDS(new_size);
end = mba + SIZEOF_StgSmallMutArrPtrs + WDS(StgSmallMutArrPtrs_ptrs(mba));
again:
ccall updateRemembSetPushClosure_(BaseReg "ptr",
W_[p] "ptr");
if (p < end) {
p = p + SIZEOF_W;
goto again;
}
}
StgSmallMutArrPtrs_ptrs(mba) = new_size;
// See the comments in overwritingClosureOfs for an explanation
// of the interaction with LDV profiling.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment