Tue Dec 1 08:03:21 PST 2009 Simon Marlow <[email protected]>
* Make allocatePinned use local storage, and other refactorings
Ignore-this: ec1334a9a5ec0de2567aa81d74b715ba
This is a batch of refactoring to remove some of the GC's global
state, as we move towards CPU-local GC.
- allocateLocal() now allocates large objects into the local
nursery, rather than taking a global lock and allocating
then in gen 0 step 0.
- allocatePinned() was still allocating from global storage and
taking a lock each time, now it uses local storage.
(mallocForeignPtrBytes should be faster with -threaded).
- We had a gen 0 step 0, distinct from the nurseries, which are
stored in a separate nurseries[] array. This is slightly strange.
I removed the g0s0 global that pointed to gen 0 step 0, and
removed all uses of it. I think now we don't use gen 0 step 0 at
all, except possibly when there is only one generation. Possibly
more tidying up is needed here.
- I removed the global allocate() function, and renamed
allocateLocal() to allocate().
- the alloc_blocks global is gone. MAYBE_GC() and
doYouWantToGC() now check the local nursery only.
M ./includes/Cmm.h -3 +4
M ./includes/mkDerivedConstants.c +3
M ./includes/rts/storage/GC.h -28 +8
M ./rts/Capability.c +1
M ./rts/Capability.h +3
M ./rts/Interpreter.c -10 +10
M ./rts/Linker.c -2 +1
M ./rts/PrimOps.cmm -5 +5
M ./rts/ProfHeap.c -1 +1
M ./rts/RaiseAsync.c -2 +2
M ./rts/RtsAPI.c -17 +17
M ./rts/STM.c -6 +6
M ./rts/Schedule.c -2 +2
M ./rts/Threads.c -3 +3
M ./rts/Weak.c -1 +1
M ./rts/sm/GC.c -25 +39
M ./rts/sm/MarkWeak.c -101 +123
M ./rts/sm/Storage.c -197 +107
M ./rts/sm/Storage.h -4 +7
View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20091201160321-12142-9df75e0269ca2225b4f9b6cedb74a2e7e845adce.gz
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc