Commit 1373cd30 authored by Simon Marlow's avatar Simon Marlow
Browse files

tiny GC optimisation

parent 5d52d9b6
......@@ -415,8 +415,7 @@ loop:
* on the CAF list, so don't do anything with it here (we'll
* scavenge it later).
*/
if (((StgIndStatic *)q)->saved_info == NULL) {
if (*IND_STATIC_LINK((StgClosure *)q) == NULL) {
if (*IND_STATIC_LINK((StgClosure *)q) == NULL) {
#ifndef THREADED_RTS
*IND_STATIC_LINK((StgClosure *)q) = gct->static_objects;
gct->static_objects = (StgClosure *)q;
......@@ -429,7 +428,6 @@ loop:
gct->static_objects = (StgClosure *)q;
}
#endif
}
}
return;
......
......@@ -126,7 +126,7 @@ revertCAFs( void )
c->saved_info = NULL;
// could, but not necessary: c->static_link = NULL;
}
revertible_caf_list = NULL;
revertible_caf_list = END_OF_STATIC_LIST;
}
void
......@@ -134,12 +134,14 @@ markCAFs (evac_fn evac, void *user)
{
StgIndStatic *c;
for (c = (StgIndStatic *)caf_list; c != NULL;
for (c = (StgIndStatic *)caf_list;
c != (StgIndStatic*)END_OF_STATIC_LIST;
c = (StgIndStatic *)c->static_link)
{
evac(user, &c->indirectee);
}
for (c = (StgIndStatic *)revertible_caf_list; c != NULL;
for (c = (StgIndStatic *)revertible_caf_list;
c != (StgIndStatic*)END_OF_STATIC_LIST;
c = (StgIndStatic *)c->static_link)
{
evac(user, &c->indirectee);
......
......@@ -177,8 +177,8 @@ initStorage( void )
allocNurseries();
weak_ptr_list = NULL;
caf_list = NULL;
revertible_caf_list = NULL;
caf_list = END_OF_STATIC_LIST;
revertible_caf_list = END_OF_STATIC_LIST;
/* initialise the allocate() interface */
alloc_blocks_lim = RtsFlags.GcFlags.minAllocAreaSize;
......@@ -231,9 +231,8 @@ freeStorage (void)
- builds a BLACKHOLE in the heap
- pushes an update frame pointing to the BLACKHOLE
- invokes UPD_CAF(), which:
- calls newCaf, below
- updates the CAF with a static indirection to the BLACKHOLE
- calls newCaf, below
- updates the CAF with a static indirection to the BLACKHOLE
Why do we build an BLACKHOLE in the heap rather than just updating
the thunk directly? It's so that we only need one kind of update
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment