projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expand the scope of the event_buf_mutex to cover io_manager_event
[ghc-hetmet.git]
/
rts
/
Weak.c
diff --git
a/rts/Weak.c
b/rts/Weak.c
index
f5e918a
..
94bead3
100644
(file)
--- a/
rts/Weak.c
+++ b/
rts/Weak.c
@@
-76,7
+76,8
@@
scheduleFinalizers(Capability *cap, StgWeak *list)
StgWeak *w;
StgTSO *t;
StgMutArrPtrs *arr;
StgWeak *w;
StgTSO *t;
StgMutArrPtrs *arr;
- nat n;
+ StgWord size;
+ nat n, i;
running_finalizers = rtsTrue;
running_finalizers = rtsTrue;
@@
-120,10
+121,12
@@
scheduleFinalizers(Capability *cap, StgWeak *list)
debugTrace(DEBUG_weak, "weak: batching %d finalizers", n);
debugTrace(DEBUG_weak, "weak: batching %d finalizers", n);
- arr = (StgMutArrPtrs *)allocate(cap, sizeofW(StgMutArrPtrs) + n);
+ size = n + mutArrPtrsCardTableSize(n);
+ arr = (StgMutArrPtrs *)allocate(cap, sizeofW(StgMutArrPtrs) + size);
TICK_ALLOC_PRIM(sizeofW(StgMutArrPtrs), n, 0);
SET_HDR(arr, &stg_MUT_ARR_PTRS_FROZEN_info, CCS_SYSTEM);
arr->ptrs = n;
TICK_ALLOC_PRIM(sizeofW(StgMutArrPtrs), n, 0);
SET_HDR(arr, &stg_MUT_ARR_PTRS_FROZEN_info, CCS_SYSTEM);
arr->ptrs = n;
+ arr->size = size;
n = 0;
for (w = list; w; w = w->link) {
n = 0;
for (w = list; w; w = w->link) {
@@
-132,6
+135,10
@@
scheduleFinalizers(Capability *cap, StgWeak *list)
n++;
}
}
n++;
}
}
+ // set all the cards to 1
+ for (i = n; i < size; i++) {
+ arr->payload[i] = (StgClosure *)(W_)(-1);
+ }
t = createIOThread(cap,
RtsFlags.GcFlags.initialStkSize,
t = createIOThread(cap,
RtsFlags.GcFlags.initialStkSize,