X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=rts%2Fsm%2FEvac.c;h=d5c9b8a4a510a20b271cfaff8b384e177de0c655;hb=1a050f3cff3a93f634d2d929aba779585f39609c;hp=21017a63a0eb6d9db6014710d5264a712dd477c9;hpb=3a90968fac18bbf931420afff6ef866614ecdd7f;p=ghc-hetmet.git diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 21017a6..d5c9b8a 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -140,14 +140,18 @@ copy_tag_nolock(StgClosure **p, const StgInfoTable *info, to = alloc_for_copy(size,gen); *p = TAG_CLOSURE(tag,(StgClosure*)to); - src->header.info = (const StgInfoTable *)MK_FORWARDING_PTR(to); - + from = (StgPtr)src; to[0] = (W_)info; for (i = 1; i < size; i++) { // unroll for small i to[i] = from[i]; } + // if somebody else reads the forwarding pointer, we better make + // sure there's a closure at the end of it. + write_barrier(); + src->header.info = (const StgInfoTable *)MK_FORWARDING_PTR(to); + // if (to+size+2 < bd->start + BLOCK_SIZE_W) { // __builtin_prefetch(to + size + 2, 1); // }