diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-10-31 13:09:35 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-10-31 13:09:35 +0000 |
commit | 698364afaf2f346227910c0cf8d4f1929cdc56ef (patch) | |
tree | 6b8bde07d6c537b7894947c295518428106a821c | |
parent | f2ca6deece1ed1724efdd6d2293dc7642059b2f2 (diff) | |
download | haskell-698364afaf2f346227910c0cf8d4f1929cdc56ef.tar.gz |
tiny optimisation in evacuate()
-rw-r--r-- | rts/sm/Evac.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index fe788cdb6f..fb9f4c49b2 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -401,7 +401,8 @@ loop: switch (info->type) { case THUNK_STATIC: - if (info->srt_bitmap != 0) { + if (info->srt_bitmap != 0 && + *THUNK_STATIC_LINK((StgClosure *)q) == NULL) { ACQUIRE_SPIN_LOCK(&static_objects_sync); if (*THUNK_STATIC_LINK((StgClosure *)q) == NULL) { *THUNK_STATIC_LINK((StgClosure *)q) = static_objects; @@ -412,7 +413,8 @@ loop: return q; case FUN_STATIC: - if (info->srt_bitmap != 0) { + if (info->srt_bitmap != 0 && + *FUN_STATIC_LINK((StgClosure *)q) == NULL) { ACQUIRE_SPIN_LOCK(&static_objects_sync); if (*FUN_STATIC_LINK((StgClosure *)q) == NULL) { *FUN_STATIC_LINK((StgClosure *)q) = static_objects; |