tiny optimisation in evacuate()
authorSimon Marlow <simonmar@microsoft.com>
Wed, 31 Oct 2007 13:09:35 +0000 (13:09 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 31 Oct 2007 13:09:35 +0000 (13:09 +0000)
rts/sm/Evac.c

index fe788cd..fb9f4c4 100644 (file)
@@ -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;