Fix #650: use a card table to mark dirty sections of mutable arrays
authorSimon Marlow <marlowsd@gmail.com>
Thu, 17 Dec 2009 22:42:28 +0000 (22:42 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 17 Dec 2009 22:42:28 +0000 (22:42 +0000)
commit0417404f5d1230c9d291ea9f73e2831121c8ec99
tree609f1be77f63606772e71ad84c7a92b205baaa9e
parentfb783aeaa5bc1cc60e6bb551c1cd01a097b84fad
Fix #650: use a card table to mark dirty sections of mutable arrays
The card table is an array of bytes, placed directly following the
actual array data.  This means that array reading is unaffected, but
array writing needs to read the array size from the header in order to
find the card table.

We use a bytemap rather than a bitmap, because updating the card table
must be multi-thread safe.  Each byte refers to 128 entries of the
array, but this is tunable by changing the constant
MUT_ARR_PTRS_CARD_BITS in includes/Constants.h.
compiler/codeGen/CgPrimOp.hs
includes/Cmm.h
includes/HaskellConstants.hs
includes/mkDerivedConstants.c
includes/rts/Constants.h
includes/rts/storage/ClosureMacros.h
includes/rts/storage/Closures.h
rts/PrimOps.cmm
rts/Weak.c
rts/sm/Scav.c