From 698364afaf2f346227910c0cf8d4f1929cdc56ef Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 31 Oct 2007 13:09:35 +0000 Subject: [PATCH] tiny optimisation in evacuate() --- rts/sm/Evac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index fe788cd..fb9f4c4 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; -- 1.7.10.4