2009-09-19 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Sat, 19 Sep 2009 11:23:29 +0000 (11:23 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:47 +0000 (21:06 +0400)
* allchblk.c: Expand all tabs to spaces; remove trailing spaces at
EOLn; remove multiple trailing blank lines.
* mark.c: Ditto.
* mark_rts.c: Ditto.
* pthread_stop_world.c: Ditto.
* win32_threads.c: Ditto.
* include/gc.h: Ditto.
* include/private/gc_priv.h: Ditto.
* pthread_stop_world.c: Add copyright header.
* include/gc.h: Reformat some comments.

ChangeLog
allchblk.c
include/gc.h
include/private/gc_priv.h
mark.c
mark_rts.c
pthread_stop_world.c
win32_threads.c

index 9f02098..0c82e22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,16 @@
 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
+       * allchblk.c: Expand all tabs to spaces; remove trailing spaces at
+       EOLn; remove multiple trailing blank lines.
+       * mark.c: Ditto.
+       * mark_rts.c: Ditto.
+       * pthread_stop_world.c: Ditto.
+       * win32_threads.c: Ditto.
+       * include/gc.h: Ditto.
+       * include/private/gc_priv.h: Ditto.
+       * pthread_stop_world.c: Add copyright header.
+       * include/gc.h: Reformat some comments.
+
+2009-09-19  Ivan Maidanski <ivmai@mail.ru>
        (ivmai130a.diff, ivmai130b.diff - superseding diff44, diff69)
 
        * include/gc.h (GC_do_blocking, GC_call_with_gc_active): New
index f6a0f4e..713e4ae 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1998-1999 by Silicon Graphics.  All rights reserved.
@@ -26,35 +26,35 @@ GC_bool GC_use_entire_heap = 0;
  * Adjacent free blocks are coalesced.
  */
 
+
 # define MAX_BLACK_LIST_ALLOC (2*HBLKSIZE)
-               /* largest block we will allocate starting on a black   */
-               /* listed block.  Must be >= HBLKSIZE.                  */
+                /* largest block we will allocate starting on a black   */
+                /* listed block.  Must be >= HBLKSIZE.                  */
 
 
 # define UNIQUE_THRESHOLD 32
-       /* Sizes up to this many HBLKs each have their own free list    */
+        /* Sizes up to this many HBLKs each have their own free list    */
 # define HUGE_THRESHOLD 256
-       /* Sizes of at least this many heap blocks are mapped to a      */
-       /* single free list.                                            */
+        /* Sizes of at least this many heap blocks are mapped to a      */
+        /* single free list.                                            */
 # define FL_COMPRESSION 8
-       /* In between sizes map this many distinct sizes to a single    */
-       /* bin.                                                         */
+        /* In between sizes map this many distinct sizes to a single    */
+        /* bin.                                                         */
 
 # define N_HBLK_FLS (HUGE_THRESHOLD - UNIQUE_THRESHOLD)/FL_COMPRESSION \
-                                + UNIQUE_THRESHOLD
+                                 + UNIQUE_THRESHOLD
 
 struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 };
 
 #ifndef USE_MUNMAP
 
   STATIC word GC_free_bytes[N_HBLK_FLS+1] = { 0 };
-       /* Number of free bytes on each list.   */
+        /* Number of free bytes on each list.   */
 
-  /* Return the largest n such that                                    */
-  /* Is GC_large_allocd_bytes + the number of free bytes on lists      */
-  /* n .. N_HBLK_FLS > GC_max_large_allocd_bytes.                      */
-  /* If there is no such n, return 0.                                  */
+  /* Return the largest n such that                                     */
+  /* Is GC_large_allocd_bytes + the number of free bytes on lists       */
+  /* n .. N_HBLK_FLS > GC_max_large_allocd_bytes.                       */
+  /* If there is no such n, return 0.                                   */
 # ifdef __GNUC__
   __inline__
 # endif
@@ -65,8 +65,8 @@ struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 };
 
     GC_ASSERT(GC_max_large_allocd_bytes <= GC_heapsize);
     for (n = N_HBLK_FLS; n >= 0; --n) {
-       bytes += GC_free_bytes[n];
-       if (bytes >= GC_max_large_allocd_bytes) return n;
+        bytes += GC_free_bytes[n];
+        if (bytes >= GC_max_large_allocd_bytes) return n;
     }
     return 0;
   }
@@ -88,8 +88,8 @@ STATIC int GC_hblk_fl_from_blocks(word blocks_needed)
     if (blocks_needed <= UNIQUE_THRESHOLD) return (int)blocks_needed;
     if (blocks_needed >= HUGE_THRESHOLD) return N_HBLK_FLS;
     return (int)(blocks_needed - UNIQUE_THRESHOLD)/FL_COMPRESSION
-                                       + UNIQUE_THRESHOLD;
-    
+                                        + UNIQUE_THRESHOLD;
+
 }
 
 # define PHDR(hhdr) HDR(hhdr -> hb_prev)
@@ -109,48 +109,48 @@ void GC_print_hblkfreelist(void)
     hdr * hhdr;
     word sz;
     unsigned i;
-    
+
     for (i = 0; i <= N_HBLK_FLS; ++i) {
       h = GC_hblkfreelist[i];
 #     ifdef USE_MUNMAP
         if (0 != h) GC_printf("Free list %u:\n", i);
 #     else
         if (0 != h) GC_printf("Free list %u (Total size %lu):\n",
-                             i, (unsigned long)GC_free_bytes[i]);
+                              i, (unsigned long)GC_free_bytes[i]);
 #     endif
       while (h != 0) {
         hhdr = HDR(h);
         sz = hhdr -> hb_sz;
-       total_free += sz;
-       GC_printf("\t%p size %lu %s black listed\n", h, (unsigned long)sz, 
-               GC_is_black_listed(h, HBLKSIZE) != 0 ? "start" :
-               GC_is_black_listed(h, hhdr -> hb_sz) != 0 ? "partially" :
-                                                       "not");
+        total_free += sz;
+        GC_printf("\t%p size %lu %s black listed\n", h, (unsigned long)sz,
+                GC_is_black_listed(h, HBLKSIZE) != 0 ? "start" :
+                GC_is_black_listed(h, hhdr -> hb_sz) != 0 ? "partially" :
+                                                        "not");
         h = hhdr -> hb_next;
       }
     }
 #   ifndef USE_MUNMAP
       if (total_free != GC_large_free_bytes) {
-       GC_printf("GC_large_free_bytes = %lu (INCONSISTENT!!)\n",
-                 (unsigned long) GC_large_free_bytes);
+        GC_printf("GC_large_free_bytes = %lu (INCONSISTENT!!)\n",
+                  (unsigned long) GC_large_free_bytes);
       }
 #   endif
     GC_printf("Total of %lu bytes on free list\n", (unsigned long)total_free);
 }
 
 /* Return the free list index on which the block described by the header */
-/* appears, or -1 if it appears nowhere.                                */
+/* appears, or -1 if it appears nowhere.                                 */
 static int free_list_index_of(hdr *wanted)
 {
     struct hblk * h;
     hdr * hhdr;
     int i;
-    
+
     for (i = 0; i <= N_HBLK_FLS; ++i) {
       h = GC_hblkfreelist[i];
       while (h != 0) {
         hhdr = HDR(h);
-       if (hhdr == wanted) return i;
+        if (hhdr == wanted) return i;
         h = hhdr -> hb_next;
       }
     }
@@ -165,61 +165,61 @@ void GC_dump_regions(void)
     size_t bytes;
     hdr *hhdr;
     for (i = 0; i < GC_n_heap_sects; ++i) {
-       start = GC_heap_sects[i].hs_start;
-       bytes = GC_heap_sects[i].hs_bytes;
-       end = start + bytes;
-       /* Merge in contiguous sections.        */
-         while (i+1 < GC_n_heap_sects && GC_heap_sects[i+1].hs_start == end) {
-           ++i;
-           end = GC_heap_sects[i].hs_start + GC_heap_sects[i].hs_bytes;
-         }
-       GC_printf("***Section from %p to %p\n", start, end);
-       for (p = start; p < end;) {
-           hhdr = HDR(p);
-           if (IS_FORWARDING_ADDR_OR_NIL(hhdr)) {
-               GC_printf("\t%p Missing header!!(%p)\n", p, hhdr);
-               p += HBLKSIZE;
-               continue;
-           }
-           if (HBLK_IS_FREE(hhdr)) {
+        start = GC_heap_sects[i].hs_start;
+        bytes = GC_heap_sects[i].hs_bytes;
+        end = start + bytes;
+        /* Merge in contiguous sections.        */
+          while (i+1 < GC_n_heap_sects && GC_heap_sects[i+1].hs_start == end) {
+            ++i;
+            end = GC_heap_sects[i].hs_start + GC_heap_sects[i].hs_bytes;
+          }
+        GC_printf("***Section from %p to %p\n", start, end);
+        for (p = start; p < end;) {
+            hhdr = HDR(p);
+            if (IS_FORWARDING_ADDR_OR_NIL(hhdr)) {
+                GC_printf("\t%p Missing header!!(%p)\n", p, hhdr);
+                p += HBLKSIZE;
+                continue;
+            }
+            if (HBLK_IS_FREE(hhdr)) {
                 int correct_index = GC_hblk_fl_from_blocks(
-                                       divHBLKSZ(hhdr -> hb_sz));
-               int actual_index;
-               
-               GC_printf("\t%p\tfree block of size 0x%lx bytes%s\n", p,
-                         (unsigned long)(hhdr -> hb_sz),
-                         IS_MAPPED(hhdr) ? "" : " (unmapped)");
-               actual_index = free_list_index_of(hhdr);
-               if (-1 == actual_index) {
-                   GC_printf("\t\tBlock not on free list %d!!\n",
-                             correct_index);
-               } else if (correct_index != actual_index) {
-                   GC_printf("\t\tBlock on list %d, should be on %d!!\n",
-                             actual_index, correct_index);
-               }
-               p += hhdr -> hb_sz;
-           } else {
-               GC_printf("\t%p\tused for blocks of size 0x%lx bytes\n", p,
-                         (unsigned long)(hhdr -> hb_sz));
-               p += HBLKSIZE * OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz);
-           }
-       }
+                                        divHBLKSZ(hhdr -> hb_sz));
+                int actual_index;
+
+                GC_printf("\t%p\tfree block of size 0x%lx bytes%s\n", p,
+                          (unsigned long)(hhdr -> hb_sz),
+                          IS_MAPPED(hhdr) ? "" : " (unmapped)");
+                actual_index = free_list_index_of(hhdr);
+                if (-1 == actual_index) {
+                    GC_printf("\t\tBlock not on free list %d!!\n",
+                              correct_index);
+                } else if (correct_index != actual_index) {
+                    GC_printf("\t\tBlock on list %d, should be on %d!!\n",
+                              actual_index, correct_index);
+                }
+                p += hhdr -> hb_sz;
+            } else {
+                GC_printf("\t%p\tused for blocks of size 0x%lx bytes\n", p,
+                          (unsigned long)(hhdr -> hb_sz));
+                p += HBLKSIZE * OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz);
+            }
+        }
     }
 }
 
 # endif /* NO_DEBUGGING */
 
-/* Initialize hdr for a block containing the indicated size and        */
-/* kind of objects.                                                    */
-/* Return FALSE on failure.                                            */
+/* Initialize hdr for a block containing the indicated size and         */
+/* kind of objects.                                                     */
+/* Return FALSE on failure.                                             */
 static GC_bool setup_header(hdr * hhdr, struct hblk *block, size_t byte_sz,
-                           int kind, unsigned flags)
+                            int kind, unsigned flags)
 {
     word descr;
 #   ifndef MARK_BIT_PER_OBJ
       size_t granules;
 #   endif
-    
+
     /* Set size, kind and mark proc fields */
       hhdr -> hb_sz = byte_sz;
       hhdr -> hb_obj_kind = (unsigned char)kind;
@@ -228,26 +228,26 @@ static GC_bool setup_header(hdr * hhdr, struct hblk *block, size_t byte_sz,
       descr = GC_obj_kinds[kind].ok_descriptor;
       if (GC_obj_kinds[kind].ok_relocate_descr) descr += byte_sz;
       hhdr -> hb_descr = descr;
-    
+
 #   ifdef MARK_BIT_PER_OBJ
-     /* Set hb_inv_sz as portably as possible.                                 */
+     /* Set hb_inv_sz as portably as possible.                          */
      /* We set it to the smallest value such that sz * inv_sz > 2**32    */
-     /* This may be more precision than necessary.                     */
+     /* This may be more precision than necessary.                      */
       if (byte_sz > MAXOBJBYTES) {
-        hhdr -> hb_inv_sz = LARGE_INV_SZ;
+         hhdr -> hb_inv_sz = LARGE_INV_SZ;
       } else {
-       word inv_sz;
+        word inv_sz;
 
 #       if CPP_WORDSZ == 64
           inv_sz = ((word)1 << 32)/byte_sz;
-         if (((inv_sz*byte_sz) >> 32) == 0) ++inv_sz;
-#      else  /* 32 bit words */
-         GC_ASSERT(byte_sz >= 4);
-         inv_sz = ((unsigned)1 << 31)/byte_sz;
-         inv_sz *= 2;
-         while (inv_sz*byte_sz > byte_sz) ++inv_sz;
-#      endif
-       hhdr -> hb_inv_sz = inv_sz;
+          if (((inv_sz*byte_sz) >> 32) == 0) ++inv_sz;
+#       else  /* 32 bit words */
+          GC_ASSERT(byte_sz >= 4);
+          inv_sz = ((unsigned)1 << 31)/byte_sz;
+          inv_sz *= 2;
+          while (inv_sz*byte_sz > byte_sz) ++inv_sz;
+#       endif
+        hhdr -> hb_inv_sz = inv_sz;
       }
 #   else /* MARK_BIT_PER_GRANULE */
       hhdr -> hb_large_block = (unsigned char)(byte_sz > MAXOBJBYTES);
@@ -264,10 +264,10 @@ static GC_bool setup_header(hdr * hhdr, struct hblk *block, size_t byte_sz,
         hhdr -> hb_map = GC_obj_map[index];
       }
 #   endif /* MARK_BIT_PER_GRANULE */
-      
+
     /* Clear mark bits */
       GC_clear_hdr_marks(hhdr);
-      
+
     hhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
     return(TRUE);
 }
@@ -284,35 +284,35 @@ STATIC void GC_remove_from_fl(hdr *hhdr, int n)
 
     GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0);
 #   ifndef USE_MUNMAP
-      /* We always need index to mainatin free counts. */
+      /* We always need index to mainatin free counts.  */
       if (FL_UNKNOWN == n) {
           index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz));
       } else {
-         index = n;
+          index = n;
       }
 #   endif
     if (hhdr -> hb_prev == 0) {
-#      ifdef USE_MUNMAP
-         if (FL_UNKNOWN == n) {
+#       ifdef USE_MUNMAP
+          if (FL_UNKNOWN == n) {
             index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz));
-         } else {
-           index = n;
-         }
-#      endif
-       GC_ASSERT(HDR(GC_hblkfreelist[index]) == hhdr);
-       GC_hblkfreelist[index] = hhdr -> hb_next;
+          } else {
+            index = n;
+          }
+#       endif
+        GC_ASSERT(HDR(GC_hblkfreelist[index]) == hhdr);
+        GC_hblkfreelist[index] = hhdr -> hb_next;
     } else {
-       hdr *phdr;
-       GET_HDR(hhdr -> hb_prev, phdr);
-       phdr -> hb_next = hhdr -> hb_next;
+        hdr *phdr;
+        GET_HDR(hhdr -> hb_prev, phdr);
+        phdr -> hb_next = hhdr -> hb_next;
     }
     FREE_ASSERT(GC_free_bytes[index] >= hhdr -> hb_sz);
     INCR_FREE_BYTES(index, - (signed_word)(hhdr -> hb_sz));
     if (0 != hhdr -> hb_next) {
-       hdr * nhdr;
-       GC_ASSERT(!IS_FORWARDING_ADDR_OR_NIL(NHDR(hhdr)));
-       GET_HDR(hhdr -> hb_next, nhdr);
-       nhdr -> hb_prev = hhdr -> hb_prev;
+        hdr * nhdr;
+        GC_ASSERT(!IS_FORWARDING_ADDR_OR_NIL(NHDR(hhdr)));
+        GET_HDR(hhdr -> hb_next, nhdr);
+        nhdr -> hb_prev = hhdr -> hb_prev;
     }
 }
 
@@ -326,21 +326,21 @@ STATIC struct hblk * GC_free_block_ending_at(struct hblk *h)
 
     GET_HDR(p, phdr);
     while (0 != phdr && IS_FORWARDING_ADDR_OR_NIL(phdr)) {
-       p = FORWARDED_ADDR(p,phdr);
-       phdr = HDR(p);
+        p = FORWARDED_ADDR(p,phdr);
+        phdr = HDR(p);
     }
     if (0 != phdr) {
         if(HBLK_IS_FREE(phdr)) {
-           return p;
-       } else {
-           return 0;
-       }
+            return p;
+        } else {
+            return 0;
+        }
     }
     p = GC_prev_block(h - 1);
     if (0 != p) {
       phdr = HDR(p);
       if (HBLK_IS_FREE(phdr) && (ptr_t)p + phdr -> hb_sz == (ptr_t)h) {
-       return p;
+        return p;
       }
     }
     return 0;
@@ -362,9 +362,9 @@ STATIC void GC_add_to_fl(struct hblk *h, hdr *hhdr)
       hdr * prevhdr = HDR(prev);
       GC_ASSERT(nexthdr == 0 || !HBLK_IS_FREE(nexthdr)
                 || (signed_word)GC_heapsize < 0);
-               /* In the last case, blocks may be too large to merge. */
+                /* In the last case, blocks may be too large to merge. */
       GC_ASSERT(prev == 0 || !HBLK_IS_FREE(prevhdr)
-               || (signed_word)GC_heapsize < 0);
+                || (signed_word)GC_heapsize < 0);
 #   endif
     GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0);
     GC_hblkfreelist[index] = h;
@@ -388,7 +388,7 @@ STATIC void GC_add_to_fl(struct hblk *h, hdr *hhdr)
 int GC_unmap_threshold = MUNMAP_THRESHOLD;
 
 /* Unmap blocks that haven't been recently touched.  This is the only way */
-/* way blocks are ever unmapped.                                         */
+/* way blocks are ever unmapped.                                          */
 void GC_unmap_old(void)
 {
     struct hblk * h;
@@ -397,80 +397,80 @@ void GC_unmap_old(void)
 
     if (GC_unmap_threshold == 0)
       return; /* unmapping disabled */
-    
+
     for (i = 0; i <= N_HBLK_FLS; ++i) {
       for (h = GC_hblkfreelist[i]; 0 != h; h = hhdr -> hb_next) {
         hhdr = HDR(h);
-       if (!IS_MAPPED(hhdr)) continue;
+        if (!IS_MAPPED(hhdr)) continue;
 
-       if ((unsigned short)GC_gc_no - hhdr -> hb_last_reclaimed >
-               (unsigned short)GC_unmap_threshold) {
-         GC_unmap((ptr_t)h, hhdr -> hb_sz);
-         hhdr -> hb_flags |= WAS_UNMAPPED;
-       }
+        if ((unsigned short)GC_gc_no - hhdr -> hb_last_reclaimed >
+                (unsigned short)GC_unmap_threshold) {
+          GC_unmap((ptr_t)h, hhdr -> hb_sz);
+          hhdr -> hb_flags |= WAS_UNMAPPED;
+        }
       }
-    }  
+    }
 }
 
-/* Merge all unmapped blocks that are adjacent to other free           */
-/* blocks.  This may involve remapping, since all blocks are either    */
-/* fully mapped or fully unmapped.                                     */
+/* Merge all unmapped blocks that are adjacent to other free            */
+/* blocks.  This may involve remapping, since all blocks are either     */
+/* fully mapped or fully unmapped.                                      */
 void GC_merge_unmapped(void)
 {
     struct hblk * h, *next;
     hdr * hhdr, *nexthdr;
     word size, nextsize;
     int i;
-    
+
     for (i = 0; i <= N_HBLK_FLS; ++i) {
       h = GC_hblkfreelist[i];
       while (h != 0) {
-       GET_HDR(h, hhdr);
-       size = hhdr->hb_sz;
-       next = (struct hblk *)((word)h + size);
-       GET_HDR(next, nexthdr);
-       /* Coalesce with successor, if possible */
-         if (0 != nexthdr && HBLK_IS_FREE(nexthdr)
-             && (signed_word) (size + (nextsize = nexthdr->hb_sz)) > 0
-                /* no pot. overflow */) {
-           /* Note that we usually try to avoid adjacent free blocks   */
-           /* that are either both mapped or both unmapped.  But that  */
-           /* isn't guaranteed to hold since we remap blocks when we   */
-           /* split them, and don't merge at that point.  It may also  */
-           /* not hold if the merged block would be too big.           */
-           if (IS_MAPPED(hhdr) && !IS_MAPPED(nexthdr)) {
-             /* make both consistent, so that we can merge */
-               if (size > nextsize) {
-                 GC_remap((ptr_t)next, nextsize);
-               } else {
-                 GC_unmap((ptr_t)h, size);
-                 GC_unmap_gap((ptr_t)h, size, (ptr_t)next, nextsize);
-                 hhdr -> hb_flags |= WAS_UNMAPPED;
-               }
-           } else if (IS_MAPPED(nexthdr) && !IS_MAPPED(hhdr)) {
-             if (size > nextsize) {
-               GC_unmap((ptr_t)next, nextsize);
-               GC_unmap_gap((ptr_t)h, size, (ptr_t)next, nextsize);
-             } else {
-               GC_remap((ptr_t)h, size);
-               hhdr -> hb_flags &= ~WAS_UNMAPPED;
-               hhdr -> hb_last_reclaimed = nexthdr -> hb_last_reclaimed;
-             }
-           } else if (!IS_MAPPED(hhdr) && !IS_MAPPED(nexthdr)) {
-             /* Unmap any gap in the middle */
-               GC_unmap_gap((ptr_t)h, size, (ptr_t)next, nextsize);
-           }
-           /* If they are both unmapped, we merge, but leave unmapped. */
-           GC_remove_from_fl(hhdr, i);
-           GC_remove_from_fl(nexthdr, FL_UNKNOWN);
-           hhdr -> hb_sz += nexthdr -> hb_sz; 
-           GC_remove_header(next);
-           GC_add_to_fl(h, hhdr); 
-           /* Start over at beginning of list */
-           h = GC_hblkfreelist[i];
-         } else /* not mergable with successor */ {
-           h = hhdr -> hb_next;
-         }
+        GET_HDR(h, hhdr);
+        size = hhdr->hb_sz;
+        next = (struct hblk *)((word)h + size);
+        GET_HDR(next, nexthdr);
+        /* Coalesce with successor, if possible */
+          if (0 != nexthdr && HBLK_IS_FREE(nexthdr)
+              && (signed_word) (size + (nextsize = nexthdr->hb_sz)) > 0
+                 /* no pot. overflow */) {
+            /* Note that we usually try to avoid adjacent free blocks   */
+            /* that are either both mapped or both unmapped.  But that  */
+            /* isn't guaranteed to hold since we remap blocks when we   */
+            /* split them, and don't merge at that point.  It may also  */
+            /* not hold if the merged block would be too big.           */
+            if (IS_MAPPED(hhdr) && !IS_MAPPED(nexthdr)) {
+              /* make both consistent, so that we can merge */
+                if (size > nextsize) {
+                  GC_remap((ptr_t)next, nextsize);
+                } else {
+                  GC_unmap((ptr_t)h, size);
+                  GC_unmap_gap((ptr_t)h, size, (ptr_t)next, nextsize);
+                  hhdr -> hb_flags |= WAS_UNMAPPED;
+                }
+            } else if (IS_MAPPED(nexthdr) && !IS_MAPPED(hhdr)) {
+              if (size > nextsize) {
+                GC_unmap((ptr_t)next, nextsize);
+                GC_unmap_gap((ptr_t)h, size, (ptr_t)next, nextsize);
+              } else {
+                GC_remap((ptr_t)h, size);
+                hhdr -> hb_flags &= ~WAS_UNMAPPED;
+                hhdr -> hb_last_reclaimed = nexthdr -> hb_last_reclaimed;
+              }
+            } else if (!IS_MAPPED(hhdr) && !IS_MAPPED(nexthdr)) {
+              /* Unmap any gap in the middle */
+                GC_unmap_gap((ptr_t)h, size, (ptr_t)next, nextsize);
+            }
+            /* If they are both unmapped, we merge, but leave unmapped. */
+            GC_remove_from_fl(hhdr, i);
+            GC_remove_from_fl(nexthdr, FL_UNKNOWN);
+            hhdr -> hb_sz += nexthdr -> hb_sz;
+            GC_remove_header(next);
+            GC_add_to_fl(h, hhdr);
+            /* Start over at beginning of list */
+            h = GC_hblkfreelist[i];
+          } else /* not mergable with successor */ {
+            h = hhdr -> hb_next;
+          }
       } /* while (h != 0) ... */
     } /* for ... */
 }
@@ -487,7 +487,7 @@ void GC_merge_unmapped(void)
  * If the return value is not 0, then hhdr is the header for it.
  */
 STATIC struct hblk * GC_get_first_part(struct hblk *h, hdr *hhdr,
-                                      size_t bytes, int index)
+                                       size_t bytes, int index)
 {
     word total_size = hhdr -> hb_sz;
     struct hblk * rest;
@@ -499,9 +499,9 @@ STATIC struct hblk * GC_get_first_part(struct hblk *h, hdr *hhdr,
     rest = (struct hblk *)((word)h + bytes);
     rest_hdr = GC_install_header(rest);
     if (0 == rest_hdr) {
-       /* FIXME: This is likely to be very bad news ... */
-       WARN("Header allocation failed: Dropping block.\n", 0);
-       return(0);
+        /* FIXME: This is likely to be very bad news ... */
+        WARN("Header allocation failed: Dropping block.\n", 0);
+        return(0);
     }
     rest_hdr -> hb_sz = total_size - bytes;
     rest_hdr -> hb_flags = 0;
@@ -528,7 +528,7 @@ STATIC struct hblk * GC_get_first_part(struct hblk *h, hdr *hhdr,
  * rare enough that it doesn't matter.  The code is cleaner this way.)
  */
 STATIC void GC_split_block(struct hblk *h, hdr *hhdr, struct hblk *n,
-                          hdr *nhdr, int index /* Index of free list */)
+                           hdr *nhdr, int index /* Index of free list */)
 {
     word total_size = hhdr -> hb_sz;
     word h_size = (word)n - (word)h;
@@ -541,12 +541,12 @@ STATIC void GC_split_block(struct hblk *h, hdr *hhdr, struct hblk *n,
       nhdr -> hb_sz = total_size - h_size;
       nhdr -> hb_flags = 0;
       if (0 != prev) {
-       HDR(prev) -> hb_next = n;
+        HDR(prev) -> hb_next = n;
       } else {
         GC_hblkfreelist[index] = n;
       }
       if (0 != next) {
-       HDR(next) -> hb_prev = n;
+        HDR(next) -> hb_prev = n;
       }
       INCR_FREE_BYTES(index, -(signed_word)h_size);
       FREE_ASSERT(GC_free_bytes[index] > 0);
@@ -557,10 +557,10 @@ STATIC void GC_split_block(struct hblk *h, hdr *hhdr, struct hblk *n,
     GC_add_to_fl(h, hhdr);
     nhdr -> hb_flags |= FREE_BLK;
 }
-       
+
 STATIC struct hblk *
 GC_allochblk_nth(size_t sz/* bytes */, int kind, unsigned flags, int n,
-                GC_bool may_split);
+                 GC_bool may_split);
 
 /*
  * Allocate (and return pointer to) a heap block
@@ -578,8 +578,8 @@ GC_allochblk(size_t sz, int kind, unsigned flags/* IGNORE_OFF_PAGE or 0 */)
     int start_list;
     int i;
     struct hblk *result;
-    int split_limit; /* Highest index of free list whose blocks we     */
-                    /* split.                                          */
+    int split_limit; /* Highest index of free list whose blocks we      */
+                     /* split.                                          */
 
     GC_ASSERT((sz & (GRANULE_BYTES - 1)) == 0);
     blocks = OBJ_SZ_TO_BLOCKS(sz);
@@ -591,38 +591,38 @@ GC_allochblk(size_t sz, int kind, unsigned flags/* IGNORE_OFF_PAGE or 0 */)
     result = GC_allochblk_nth(sz, kind, flags, start_list, FALSE);
     if (0 != result) return result;
     if (GC_use_entire_heap || GC_dont_gc
-       || USED_HEAP_SIZE < GC_requested_heapsize
+        || USED_HEAP_SIZE < GC_requested_heapsize
         || GC_incremental || !GC_should_collect()) {
-       /* Should use more of the heap, even if it requires splitting. */
-       split_limit = N_HBLK_FLS;
+        /* Should use more of the heap, even if it requires splitting. */
+        split_limit = N_HBLK_FLS;
     } else {
 #     ifdef USE_MUNMAP
-       /* avoid splitting, since that might require remapping */
-       split_limit = 0;
+        /* avoid splitting, since that might require remapping */
+        split_limit = 0;
 #     else
-       if (GC_finalizer_bytes_freed > (GC_heapsize >> 4))  {
-         /* If we are deallocating lots of memory from         */
-         /* finalizers, fail and collect sooner rather         */
-         /* than later.                                        */
-         split_limit = 0;
-       } else {
-         /* If we have enough large blocks left to cover any   */
-         /* previous request for large blocks, we go ahead     */
-         /* and split.  Assuming a steady state, that should   */
-         /* be safe.  It means that we can use the full        */
-         /* heap if we allocate only small objects.            */
+        if (GC_finalizer_bytes_freed > (GC_heapsize >> 4))  {
+          /* If we are deallocating lots of memory from         */
+          /* finalizers, fail and collect sooner rather         */
+          /* than later.                                        */
+          split_limit = 0;
+        } else {
+          /* If we have enough large blocks left to cover any   */
+          /* previous request for large blocks, we go ahead     */
+          /* and split.  Assuming a steady state, that should   */
+          /* be safe.  It means that we can use the full        */
+          /* heap if we allocate only small objects.            */
           split_limit = GC_enough_large_bytes_left();
-       }
+        }
 #     endif
     }
     if (start_list < UNIQUE_THRESHOLD) {
-      /* No reason to try start_list again, since all blocks are exact */
-      /* matches.                                                      */
+      /* No reason to try start_list again, since all blocks are exact  */
+      /* matches.                                                       */
       ++start_list;
     }
     for (i = start_list; i <= split_limit; ++i) {
-       struct hblk * result = GC_allochblk_nth(sz, kind, flags, i, TRUE);
-       if (0 != result) return result;
+        struct hblk * result = GC_allochblk_nth(sz, kind, flags, i, TRUE);
+        if (0 != result) return result;
     }
     return 0;
 }
@@ -636,153 +636,153 @@ STATIC struct hblk *
 GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, GC_bool may_split)
 {
     struct hblk *hbp;
-    hdr * hhdr;                /* Header corr. to hbp */
-                       /* Initialized after loop if hbp !=0    */
-                       /* Gcc uninitialized use warning is bogus.      */
+    hdr * hhdr;         /* Header corr. to hbp */
+                        /* Initialized after loop if hbp !=0    */
+                        /* Gcc uninitialized use warning is bogus.      */
     struct hblk *thishbp;
-    hdr * thishdr;             /* Header corr. to hbp */
+    hdr * thishdr;              /* Header corr. to hbp */
     signed_word size_needed;    /* number of bytes in requested objects */
-    signed_word size_avail;    /* bytes available in this block        */
+    signed_word size_avail;     /* bytes available in this block        */
 
     size_needed = HBLKSIZE * OBJ_SZ_TO_BLOCKS(sz);
 
     /* search for a big enough block in free list */
-       hbp = GC_hblkfreelist[n];
-       for(; 0 != hbp; hbp = hhdr -> hb_next) {
-           GET_HDR(hbp, hhdr);
-           size_avail = hhdr->hb_sz;
-           if (size_avail < size_needed) continue;
-           if (size_avail != size_needed) {
-             signed_word next_size;
-
-             if (!may_split) continue;
-             /* If the next heap block is obviously better, go on.     */
-             /* This prevents us from disassembling a single large block */
-             /* to get tiny blocks.                                    */
-             thishbp = hhdr -> hb_next;
-             if (thishbp != 0) {
-               GET_HDR(thishbp, thishdr);
-               next_size = (signed_word)(thishdr -> hb_sz);
-               if (next_size < size_avail
-                   && next_size >= size_needed
-                   && !GC_is_black_listed(thishbp, (word)size_needed)) {
-                   continue;
-               }
-             }
-           }
-           if ( !IS_UNCOLLECTABLE(kind) &&
-                (kind != PTRFREE || size_needed > MAX_BLACK_LIST_ALLOC)) {
-             struct hblk * lasthbp = hbp;
-             ptr_t search_end = (ptr_t)hbp + size_avail - size_needed;
-             signed_word orig_avail = size_avail;
-             signed_word eff_size_needed = ((flags & IGNORE_OFF_PAGE)?
-                                               HBLKSIZE
-                                               : size_needed);
-             
-             
-             while ((ptr_t)lasthbp <= search_end
-                    && (thishbp = GC_is_black_listed(lasthbp,
-                                                     (word)eff_size_needed))
-                       != 0) {
-               lasthbp = thishbp;
-             }
-             size_avail -= (ptr_t)lasthbp - (ptr_t)hbp;
-             thishbp = lasthbp;
-             if (size_avail >= size_needed) {
-               if (thishbp != hbp &&
-                   0 != (thishdr = GC_install_header(thishbp))) {
-                 /* Make sure it's mapped before we mangle it. */
-#                  ifdef USE_MUNMAP
-                     if (!IS_MAPPED(hhdr)) {
-                       GC_remap((ptr_t)hbp, hhdr -> hb_sz);
-                       hhdr -> hb_flags &= ~WAS_UNMAPPED;
-                     }
-#                  endif
-                 /* Split the block at thishbp */
-                     GC_split_block(hbp, hhdr, thishbp, thishdr, n);
-                 /* Advance to thishbp */
-                     hbp = thishbp;
-                     hhdr = thishdr;
-                     /* We must now allocate thishbp, since it may     */
-                     /* be on the wrong free list.                     */
-               }
-             } else if (size_needed > (signed_word)BL_LIMIT
-                        && orig_avail - size_needed
-                           > (signed_word)BL_LIMIT) {
-               /* Punt, since anything else risks unreasonable heap growth. */
-               if (++GC_large_alloc_warn_suppressed
-                   >= GC_large_alloc_warn_interval) {
-                 WARN("Repeated allocation of very large block "
-                      "(appr. size %" GC_PRIdPTR "):\n"
-                      "\tMay lead to memory leak and poor performance.\n",
-                      size_needed);
-                 GC_large_alloc_warn_suppressed = 0;
-               }
-               size_avail = orig_avail;
-             } else if (size_avail == 0 && size_needed == HBLKSIZE
-                        && IS_MAPPED(hhdr)) {
-               if (!GC_find_leak) {
-                 static unsigned count = 0;
-                 
-                 /* The block is completely blacklisted.  We need      */
-                 /* to drop some such blocks, since otherwise we spend */
-                 /* all our time traversing them if pointerfree        */
-                 /* blocks are unpopular.                              */
-                 /* A dropped block will be reconsidered at next GC.   */
-                 if ((++count & 3) == 0) {
-                   /* Allocate and drop the block in small chunks, to  */
-                   /* maximize the chance that we will recover some    */
-                   /* later.                                           */
-                     word total_size = hhdr -> hb_sz;
-                     struct hblk * limit = hbp + divHBLKSZ(total_size);
-                     struct hblk * h;
-                     struct hblk * prev = hhdr -> hb_prev;
-                     
-                     GC_large_free_bytes -= total_size;
-                     GC_bytes_dropped += total_size;
-                     GC_remove_from_fl(hhdr, n);
-                     for (h = hbp; h < limit; h++) {
-                       if (h == hbp || 0 != (hhdr = GC_install_header(h))) {
-                         (void) setup_header(
-                                 hhdr, h,
-                                 HBLKSIZE,
-                                 PTRFREE, 0); /* Cant fail */
-                         if (GC_debugging_started) {
-                           BZERO(h, HBLKSIZE);
-                         }
-                       }
-                     }
-                   /* Restore hbp to point at free block */
-                     hbp = prev;
-                     if (0 == hbp) {
-                       return GC_allochblk_nth(sz, kind, flags, n, may_split);
-                     }
-                     hhdr = HDR(hbp);
-                 }
-               }
-             }
-           }
-           if( size_avail >= size_needed ) {
-#              ifdef USE_MUNMAP
-                 if (!IS_MAPPED(hhdr)) {
-                   GC_remap((ptr_t)hbp, hhdr -> hb_sz);
-                   hhdr -> hb_flags &= ~WAS_UNMAPPED;
-                   /* Note: This may leave adjacent, mapped free blocks. */
-                 }
-#              endif
-               /* hbp may be on the wrong freelist; the parameter n    */
-               /* is important.                                        */
-               hbp = GC_get_first_part(hbp, hhdr, size_needed, n);
-               break;
-           }
-       }
+        hbp = GC_hblkfreelist[n];
+        for(; 0 != hbp; hbp = hhdr -> hb_next) {
+            GET_HDR(hbp, hhdr);
+            size_avail = hhdr->hb_sz;
+            if (size_avail < size_needed) continue;
+            if (size_avail != size_needed) {
+              signed_word next_size;
+
+              if (!may_split) continue;
+              /* If the next heap block is obviously better, go on.     */
+              /* This prevents us from disassembling a single large block */
+              /* to get tiny blocks.                                    */
+              thishbp = hhdr -> hb_next;
+              if (thishbp != 0) {
+                GET_HDR(thishbp, thishdr);
+                next_size = (signed_word)(thishdr -> hb_sz);
+                if (next_size < size_avail
+                    && next_size >= size_needed
+                    && !GC_is_black_listed(thishbp, (word)size_needed)) {
+                    continue;
+                }
+              }
+            }
+            if ( !IS_UNCOLLECTABLE(kind) &&
+                 (kind != PTRFREE || size_needed > MAX_BLACK_LIST_ALLOC)) {
+              struct hblk * lasthbp = hbp;
+              ptr_t search_end = (ptr_t)hbp + size_avail - size_needed;
+              signed_word orig_avail = size_avail;
+              signed_word eff_size_needed = ((flags & IGNORE_OFF_PAGE)?
+                                                HBLKSIZE
+                                                : size_needed);
+
+
+              while ((ptr_t)lasthbp <= search_end
+                     && (thishbp = GC_is_black_listed(lasthbp,
+                                                      (word)eff_size_needed))
+                        != 0) {
+                lasthbp = thishbp;
+              }
+              size_avail -= (ptr_t)lasthbp - (ptr_t)hbp;
+              thishbp = lasthbp;
+              if (size_avail >= size_needed) {
+                if (thishbp != hbp &&
+                    0 != (thishdr = GC_install_header(thishbp))) {
+                  /* Make sure it's mapped before we mangle it. */
+#                   ifdef USE_MUNMAP
+                      if (!IS_MAPPED(hhdr)) {
+                        GC_remap((ptr_t)hbp, hhdr -> hb_sz);
+                        hhdr -> hb_flags &= ~WAS_UNMAPPED;
+                      }
+#                   endif
+                  /* Split the block at thishbp */
+                      GC_split_block(hbp, hhdr, thishbp, thishdr, n);
+                  /* Advance to thishbp */
+                      hbp = thishbp;
+                      hhdr = thishdr;
+                      /* We must now allocate thishbp, since it may     */
+                      /* be on the wrong free list.                     */
+                }
+              } else if (size_needed > (signed_word)BL_LIMIT
+                         && orig_avail - size_needed
+                            > (signed_word)BL_LIMIT) {
+                /* Punt, since anything else risks unreasonable heap growth. */
+                if (++GC_large_alloc_warn_suppressed
+                    >= GC_large_alloc_warn_interval) {
+                  WARN("Repeated allocation of very large block "
+                       "(appr. size %" GC_PRIdPTR "):\n"
+                       "\tMay lead to memory leak and poor performance.\n",
+                       size_needed);
+                  GC_large_alloc_warn_suppressed = 0;
+                }
+                size_avail = orig_avail;
+              } else if (size_avail == 0 && size_needed == HBLKSIZE
+                         && IS_MAPPED(hhdr)) {
+                if (!GC_find_leak) {
+                  static unsigned count = 0;
+
+                  /* The block is completely blacklisted.  We need      */
+                  /* to drop some such blocks, since otherwise we spend */
+                  /* all our time traversing them if pointerfree        */
+                  /* blocks are unpopular.                              */
+                  /* A dropped block will be reconsidered at next GC.   */
+                  if ((++count & 3) == 0) {
+                    /* Allocate and drop the block in small chunks, to  */
+                    /* maximize the chance that we will recover some    */
+                    /* later.                                           */
+                      word total_size = hhdr -> hb_sz;
+                      struct hblk * limit = hbp + divHBLKSZ(total_size);
+                      struct hblk * h;
+                      struct hblk * prev = hhdr -> hb_prev;
+
+                      GC_large_free_bytes -= total_size;
+                      GC_bytes_dropped += total_size;
+                      GC_remove_from_fl(hhdr, n);
+                      for (h = hbp; h < limit; h++) {
+                        if (h == hbp || 0 != (hhdr = GC_install_header(h))) {
+                          (void) setup_header(
+                                  hhdr, h,
+                                  HBLKSIZE,
+                                  PTRFREE, 0); /* Cant fail */
+                          if (GC_debugging_started) {
+                            BZERO(h, HBLKSIZE);
+                          }
+                        }
+                      }
+                    /* Restore hbp to point at free block */
+                      hbp = prev;
+                      if (0 == hbp) {
+                        return GC_allochblk_nth(sz, kind, flags, n, may_split);
+                      }
+                      hhdr = HDR(hbp);
+                  }
+                }
+              }
+            }
+            if( size_avail >= size_needed ) {
+#               ifdef USE_MUNMAP
+                  if (!IS_MAPPED(hhdr)) {
+                    GC_remap((ptr_t)hbp, hhdr -> hb_sz);
+                    hhdr -> hb_flags &= ~WAS_UNMAPPED;
+                    /* Note: This may leave adjacent, mapped free blocks. */
+                  }
+#               endif
+                /* hbp may be on the wrong freelist; the parameter n    */
+                /* is important.                                        */
+                hbp = GC_get_first_part(hbp, hhdr, size_needed, n);
+                break;
+            }
+        }
 
     if (0 == hbp) return 0;
-       
+
     /* Add it to map of valid blocks */
-       if (!GC_install_counts(hbp, (word)size_needed)) return(0);
-       /* This leaks memory under very rare conditions. */
-               
+        if (!GC_install_counts(hbp, (word)size_needed)) return(0);
+        /* This leaks memory under very rare conditions. */
+
     /* Set up header */
         if (!setup_header(hhdr, hbp, sz, kind, flags)) {
             GC_remove_counts(hbp, (word)size_needed);
@@ -792,25 +792,25 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, GC_bool may_split)
     /* Notify virtual dirty bit implementation that we are about to write.  */
     /* Ensure that pointerfree objects are not protected if it's avoidable. */
     /* This also ensures that newly allocated blocks are treated as dirty.  */
-    /* Necessary since we don't protect free blocks.                       */
-       GC_ASSERT((size_needed & (HBLKSIZE-1)) == 0);
-       GC_remove_protection(hbp, divHBLKSZ(size_needed),
-                            (hhdr -> hb_descr == 0) /* pointer-free */);
-        
-    /* We just successfully allocated a block.  Restart count of       */
-    /* consecutive failures.                                           */
+    /* Necessary since we don't protect free blocks.                        */
+        GC_ASSERT((size_needed & (HBLKSIZE-1)) == 0);
+        GC_remove_protection(hbp, divHBLKSZ(size_needed),
+                             (hhdr -> hb_descr == 0) /* pointer-free */);
+
+    /* We just successfully allocated a block.  Restart count of        */
+    /* consecutive failures.                                            */
     {
-       extern unsigned GC_fail_count;
-       
-       GC_fail_count = 0;
+        extern unsigned GC_fail_count;
+
+        GC_fail_count = 0;
     }
 
     GC_large_free_bytes -= size_needed;
-    
+
     GC_ASSERT(IS_MAPPED(hhdr));
     return( hbp );
 }
+
 /*
  * Free a heap block.
  *
@@ -833,17 +833,17 @@ signed_word size;
       ABORT("Deallocating excessively large block.  Too large an allocation?");
       /* Probably possible if we try to allocate more than half the address */
       /* space at once.  If we dont catch it here, strange things happen    */
-      /* later.                                                                    */
+      /* later.                                                             */
     GC_remove_counts(hbp, (word)size);
     hhdr->hb_sz = size;
 #   ifdef USE_MUNMAP
       hhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
 #   endif
-    
+
     /* Check for duplicate deallocation in the easy case */
       if (HBLK_IS_FREE(hhdr)) {
         GC_printf("Duplicate large block deallocation of %p\n", hbp);
-       ABORT("Duplicate large block deallocation");
+        ABORT("Duplicate large block deallocation");
       }
 
     GC_ASSERT(IS_MAPPED(hhdr));
@@ -854,31 +854,30 @@ signed_word size;
     /* Coalesce with successor, if possible */
       if(0 != nexthdr && HBLK_IS_FREE(nexthdr) && IS_MAPPED(nexthdr)
          && (signed_word)(hhdr -> hb_sz + nexthdr -> hb_sz) > 0
-        /* no overflow */) {
-       GC_remove_from_fl(nexthdr, FL_UNKNOWN);
-       hhdr -> hb_sz += nexthdr -> hb_sz; 
-       GC_remove_header(next);
+         /* no overflow */) {
+        GC_remove_from_fl(nexthdr, FL_UNKNOWN);
+        hhdr -> hb_sz += nexthdr -> hb_sz;
+        GC_remove_header(next);
       }
     /* Coalesce with predecessor, if possible. */
       if (0 != prev) {
-       prevhdr = HDR(prev);
-       if (IS_MAPPED(prevhdr)
-           && (signed_word)(hhdr -> hb_sz + prevhdr -> hb_sz) > 0) {
-         GC_remove_from_fl(prevhdr, FL_UNKNOWN);
-         prevhdr -> hb_sz += hhdr -> hb_sz;
-#        ifdef USE_MUNMAP
-           prevhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
-#        endif
-         GC_remove_header(hbp);
-         hbp = prev;
-         hhdr = prevhdr;
-       }
+        prevhdr = HDR(prev);
+        if (IS_MAPPED(prevhdr)
+            && (signed_word)(hhdr -> hb_sz + prevhdr -> hb_sz) > 0) {
+          GC_remove_from_fl(prevhdr, FL_UNKNOWN);
+          prevhdr -> hb_sz += hhdr -> hb_sz;
+#         ifdef USE_MUNMAP
+            prevhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
+#         endif
+          GC_remove_header(hbp);
+          hbp = prev;
+          hhdr = prevhdr;
+        }
       }
-    /* FIXME: It is not clear we really always want to do these merges */
-    /* with -DUSE_MUNMAP, since it updates ages and hence prevents     */
-    /* unmapping.                                                      */
+    /* FIXME: It is not clear we really always want to do these merges  */
+    /* with -DUSE_MUNMAP, since it updates ages and hence prevents      */
+    /* unmapping.                                                       */
 
     GC_large_free_bytes += size;
-    GC_add_to_fl(hbp, hhdr);    
+    GC_add_to_fl(hbp, hhdr);
 }
-
index 210e91f..3a83f30 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  * Copyright (c) 1991-1995 by Xerox Corporation.  All rights reserved.
  * Copyright 1996-1999 by Silicon Graphics.  All rights reserved.
  * Everything else is best ignored unless you encounter performance
  * problems.
  */
+
 #ifndef _GC_H
 
 # define _GC_H
 
 # include "gc_version.h"
-       /* Define version numbers here to allow test on build machine   */
-       /* for cross-builds.  Note that this defines the header         */
-       /* version number, which may or may not match that of the       */
-       /* dynamic library.  The GC_version variable can be used        */
-       /* to obtain the latter.                                        */
+        /* Define version numbers here to allow test on build machine   */
+        /* for cross-builds.  Note that this defines the header         */
+        /* version number, which may or may not match that of the       */
+        /* dynamic library.  The GC_version variable can be used        */
+        /* to obtain the latter.                                        */
 
 # include "gc_config_macros.h"
 
 # endif
 
 
-/* Define word and signed_word to be unsigned and signed types of the  */
-/* size as char * or void *.  There seems to be no way to do this      */
-/* even semi-portably.  The following is probably no better/worse      */
-/* than almost anything else.                                          */
-/* The ANSI standard suggests that size_t and ptrdiff_t might be       */
-/* better choices.  But those had incorrect definitions on some older  */
-/* systems.  Notably "typedef int size_t" is WRONG.                    */
+/* Define word and signed_word to be unsigned and signed types of the   */
+/* size as char * or void *.  There seems to be no way to do this       */
+/* even semi-portably.  The following is probably no better/worse       */
+/* than almost anything else.                                           */
+/* The ANSI standard suggests that size_t and ptrdiff_t might be        */
+/* better choices.  But those had incorrect definitions on some older   */
+/* systems.  Notably "typedef int size_t" is WRONG.                     */
 #ifndef _WIN64
   typedef unsigned long GC_word;
   typedef long GC_signed_word;
 #endif
 
 /* Public read-only variables */
-/* The supplied getter functions are preferred for new code.           */
+/* The supplied getter functions are preferred for new code.            */
 
-GC_API GC_word GC_gc_no;/* Counter incremented per collection.         */
-                       /* Includes empty GCs at startup.               */
+GC_API GC_word GC_gc_no;/* Counter incremented per collection.          */
+                        /* Includes empty GCs at startup.               */
 GC_API GC_word GC_CALL GC_get_gc_no(void);
-                       /* GC_get_gc_no() uses no synchronization, so   */
-                       /* it requires GC_call_with_alloc_lock() to     */
-                       /* avoid data races on multiprocessors.         */
-
-GC_API int GC_parallel;        /* GC is parallelized for performance on        */
-                       /* multiprocessors.  Currently set only         */
-                       /* implicitly if collector is built with        */
-                       /* -DPARALLEL_MARK and if either:               */
-                       /*  Env variable GC_NPROC is set to > 1, or     */
-                       /*  GC_NPROC is not set and this is an MP.      */
-                       /* If GC_parallel is set, incremental           */
-                       /* collection is only partially functional,     */
-                       /* and may not be desirable.                    */
+                        /* GC_get_gc_no() uses no synchronization, so   */
+                        /* it requires GC_call_with_alloc_lock() to     */
+                        /* avoid data races on multiprocessors.         */
+
+GC_API int GC_parallel; /* GC is parallelized for performance on        */
+                        /* multiprocessors.  Currently set only         */
+                        /* implicitly if collector is built with        */
+                        /* -DPARALLEL_MARK and if either:               */
+                        /*  Env variable GC_NPROC is set to > 1, or     */
+                        /*  GC_NPROC is not set and this is an MP.      */
+                        /* If GC_parallel is set, incremental           */
+                        /* collection is only partially functional,     */
+                        /* and may not be desirable.                    */
 GC_API int GC_CALL GC_get_parallel(void);
-                       
+
 
 /* Public R/W variables */
-/* The supplied setter and getter functions are preferred for new code.        */
+/* The supplied setter and getter functions are preferred for new code. */
 
 typedef void * (GC_CALLBACK * GC_oom_func)(size_t /* bytes_requested */);
 GC_API GC_oom_func GC_oom_fn;
-                       /* When there is insufficient memory to satisfy */
-                       /* an allocation request, we return             */
-                       /* (*GC_oom_fn)(size).  By default this just    */
-                       /* returns NULL.                                */
-                       /* If it returns, it must return 0 or a valid   */
-                       /* pointer to a previously allocated heap       */
-                       /* object.  GC_oom_fn must not be 0.            */
-                       /* Both the supplied setter and the getter      */
-                       /* acquire the GC lock (to avoid data races).   */
+                        /* When there is insufficient memory to satisfy */
+                        /* an allocation request, we return             */
+                        /* (*GC_oom_fn)(size).  By default this just    */
+                        /* returns NULL.                                */
+                        /* If it returns, it must return 0 or a valid   */
+                        /* pointer to a previously allocated heap       */
+                        /* object.  GC_oom_fn must not be 0.            */
+                        /* Both the supplied setter and the getter      */
+                        /* acquire the GC lock (to avoid data races).   */
 GC_API void GC_CALL GC_set_oom_fn(GC_oom_func);
 GC_API GC_oom_func GC_CALL GC_get_oom_fn(void);
 
 GC_API int GC_find_leak;
-                       /* Do not actually garbage collect, but simply  */
-                       /* report inaccessible memory that was not      */
-                       /* deallocated with GC_free.  Initial value     */
-                       /* is determined by FIND_LEAK macro.            */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                        /* Do not actually garbage collect, but simply  */
+                        /* report inaccessible memory that was not      */
+                        /* deallocated with GC_free.  Initial value     */
+                        /* is determined by FIND_LEAK macro.            */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_find_leak(int);
 GC_API int GC_CALL GC_get_find_leak(void);
 
 GC_API int GC_all_interior_pointers;
-                       /* Arrange for pointers to object interiors to  */
-                       /* be recognized as valid.  May not be changed  */
-                       /* after GC initialization.                     */
-                       /* Initial value is determined by               */
-                       /* -DALL_INTERIOR_POINTERS.                     */
-                       /* Unless DONT_ADD_BYTE_AT_END is defined, this */
-                       /* also affects whether sizes are increased by  */
-                       /* at least a byte to allow "off the end"       */
-                       /* pointer recognition.                         */
-                       /* MUST BE 0 or 1.                              */
+                        /* Arrange for pointers to object interiors to  */
+                        /* be recognized as valid.  May not be changed  */
+                        /* after GC initialization.                     */
+                        /* Initial value is determined by               */
+                        /* -DALL_INTERIOR_POINTERS.                     */
+                        /* Unless DONT_ADD_BYTE_AT_END is defined, this */
+                        /* also affects whether sizes are increased by  */
+                        /* at least a byte to allow "off the end"       */
+                        /* pointer recognition.                         */
+                        /* MUST BE 0 or 1.                              */
 GC_API void GC_CALL GC_set_all_interior_pointers(int);
 GC_API int GC_CALL GC_get_all_interior_pointers(void);
 
 GC_API int GC_finalize_on_demand;
-                       /* If nonzero, finalizers will only be run in   */
-                       /* response to an explicit GC_invoke_finalizers */
-                       /* call.  The default is determined by whether  */
-                       /* the FINALIZE_ON_DEMAND macro is defined      */
-                       /* when the collector is built.                 */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                        /* If nonzero, finalizers will only be run in   */
+                        /* response to an explicit GC_invoke_finalizers */
+                        /* call.  The default is determined by whether  */
+                        /* the FINALIZE_ON_DEMAND macro is defined      */
+                        /* when the collector is built.                 */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_finalize_on_demand(int);
 GC_API int GC_CALL GC_get_finalize_on_demand(void);
 
 GC_API int GC_java_finalization;
-                       /* Mark objects reachable from finalizable      */
-                       /* objects in a separate post-pass.  This makes */
-                       /* it a bit safer to use non-topologically-     */
-                       /* ordered finalization.  Default value is      */
-                       /* determined by JAVA_FINALIZATION macro.       */
-                       /* Enables register_finalizer_unreachable to    */
-                       /* work correctly.                              */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                        /* Mark objects reachable from finalizable      */
+                        /* objects in a separate post-pass.  This makes */
+                        /* it a bit safer to use non-topologically-     */
+                        /* ordered finalization.  Default value is      */
+                        /* determined by JAVA_FINALIZATION macro.       */
+                        /* Enables register_finalizer_unreachable to    */
+                        /* work correctly.                              */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_java_finalization(int);
 GC_API int GC_CALL GC_get_java_finalization(void);
 
 typedef void (GC_CALLBACK * GC_finalizer_notifier_proc)(void);
 GC_API GC_finalizer_notifier_proc GC_finalizer_notifier;
-                       /* Invoked by the collector when there are      */
-                       /* objects to be finalized.  Invoked at most    */
-                       /* once per GC cycle.  Never invoked unless     */
-                       /* GC_finalize_on_demand is set.                */
-                       /* Typically this will notify a finalization    */
-                       /* thread, which will call GC_invoke_finalizers */
-                       /* in response.  May be 0 (means no notifier).  */
-                       /* Both the supplied setter and the getter      */
-                       /* acquire the GC lock (to avoid data races).   */
+                        /* Invoked by the collector when there are      */
+                        /* objects to be finalized.  Invoked at most    */
+                        /* once per GC cycle.  Never invoked unless     */
+                        /* GC_finalize_on_demand is set.                */
+                        /* Typically this will notify a finalization    */
+                        /* thread, which will call GC_invoke_finalizers */
+                        /* in response.  May be 0 (means no notifier).  */
+                        /* Both the supplied setter and the getter      */
+                        /* acquire the GC lock (to avoid data races).   */
 GC_API void GC_CALL GC_set_finalizer_notifier(GC_finalizer_notifier_proc);
 GC_API GC_finalizer_notifier_proc GC_CALL GC_get_finalizer_notifier(void);
 
-GC_API int GC_dont_gc; /* != 0 ==> Dont collect.  In versions 6.2a1+,  */
-                       /* this overrides explicit GC_gcollect() calls. */
-                       /* Used as a counter, so that nested enabling   */
-                       /* and disabling work correctly.  Should        */
-                       /* normally be updated with GC_enable() and     */
-                       /* GC_disable() calls.                          */
-                       /* Direct assignment to GC_dont_gc is           */
-                       /* deprecated.                                  */
+GC_API int GC_dont_gc;  /* != 0 ==> Dont collect.  In versions 6.2a1+,  */
+                        /* this overrides explicit GC_gcollect() calls. */
+                        /* Used as a counter, so that nested enabling   */
+                        /* and disabling work correctly.  Should        */
+                        /* normally be updated with GC_enable() and     */
+                        /* GC_disable() calls.                          */
+                        /* Direct assignment to GC_dont_gc is           */
+                        /* deprecated.                                  */
 
 GC_API int GC_dont_expand;
-                       /* Dont expand heap unless explicitly requested */
-                       /* or forced to.                                */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                        /* Dont expand heap unless explicitly requested */
+                        /* or forced to.                                */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_dont_expand(int);
 GC_API int GC_CALL GC_get_dont_expand(void);
 
 GC_API int GC_use_entire_heap;
-               /* Causes the non-incremental collector to use the      */
-               /* entire heap before collecting.  This was the only    */
-               /* option for GC versions < 5.0.  This sometimes        */
-               /* results in more large block fragmentation, since     */
-               /* very large blocks will tend to get broken up         */
-               /* during each GC cycle.  It is likely to result in a   */
-               /* larger working set, but lower collection             */
-               /* frequencies, and hence fewer instructions executed   */
-               /* in the collector.                                    */
-
-GC_API int GC_full_freq;    /* Number of partial collections between   */
-                           /* full collections.  Matters only if       */
-                           /* GC_incremental is set.                   */
-                           /* Full collections are also triggered if   */
-                           /* the collector detects a substantial      */
-                           /* increase in the number of in-use heap    */
-                           /* blocks.  Values in the tens are now      */
-                           /* perfectly reasonable, unlike for         */
-                           /* earlier GC versions.                     */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                /* Causes the non-incremental collector to use the      */
+                /* entire heap before collecting.  This was the only    */
+                /* option for GC versions < 5.0.  This sometimes        */
+                /* results in more large block fragmentation, since     */
+                /* very large blocks will tend to get broken up         */
+                /* during each GC cycle.  It is likely to result in a   */
+                /* larger working set, but lower collection             */
+                /* frequencies, and hence fewer instructions executed   */
+                /* in the collector.                                    */
+
+GC_API int GC_full_freq;    /* Number of partial collections between    */
+                            /* full collections.  Matters only if       */
+                            /* GC_incremental is set.                   */
+                            /* Full collections are also triggered if   */
+                            /* the collector detects a substantial      */
+                            /* increase in the number of in-use heap    */
+                            /* blocks.  Values in the tens are now      */
+                            /* perfectly reasonable, unlike for         */
+                            /* earlier GC versions.                     */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_full_freq(int);
 GC_API int GC_CALL GC_get_full_freq(void);
-                       
+
 GC_API GC_word GC_non_gc_bytes;
-                       /* Bytes not considered candidates for collection. */
-                       /* Used only to control scheduling of collections. */
-                       /* Updated by GC_malloc_uncollectable and GC_free. */
-                       /* Wizards only.                                   */
-                       /* The setter and getter are unsynchronized, so    */
-                       /* GC_call_with_alloc_lock() is required to        */
-                       /* avoid data races (if the value is modified      */
-                       /* after the GC is put to multi-threaded mode).    */
+                        /* Bytes not considered candidates for          */
+                        /* collection.  Used only to control scheduling */
+                        /* of collections.  Updated by                  */
+                        /* GC_malloc_uncollectable and GC_free.         */
+                        /* Wizards only.                                */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_non_gc_bytes(GC_word);
 GC_API GC_word GC_CALL GC_get_non_gc_bytes(void);
 
 GC_API int GC_no_dls;
-                       /* Don't register dynamic library data segments. */
-                       /* Wizards only.  Should be used only if the     */
-                       /* application explicitly registers all roots.   */
-                       /* In Microsoft Windows environments, this will  */
-                       /* usually also prevent registration of the      */
-                       /* main data segment as part of the root set.    */
-                       /* The setter and getter are unsynchronized, so  */
-                       /* GC_call_with_alloc_lock() is required to      */
-                       /* avoid data races (if the value is modified    */
-                       /* after the GC is put to multi-threaded mode).  */
+                        /* Don't register dynamic library data segments. */
+                        /* Wizards only.  Should be used only if the     */
+                        /* application explicitly registers all roots.   */
+                        /* In Microsoft Windows environments, this will  */
+                        /* usually also prevent registration of the      */
+                        /* main data segment as part of the root set.    */
+                        /* The setter and getter are unsynchronized, so  */
+                        /* GC_call_with_alloc_lock() is required to      */
+                        /* avoid data races (if the value is modified    */
+                        /* after the GC is put to multi-threaded mode).  */
 GC_API void GC_CALL GC_set_no_dls(int);
 GC_API int GC_CALL GC_get_no_dls(void);
 
 GC_API GC_word GC_free_space_divisor;
-                       /* We try to make sure that we allocate at      */
-                       /* least N/GC_free_space_divisor bytes between  */
-                       /* collections, where N is twice the number     */
-                       /* of traced bytes, plus the number of untraced */
-                       /* bytes (bytes in "atomic" objects), plus      */
-                       /* a rough estimate of the root set size.       */
-                       /* N approximates GC tracing work per GC.       */
-                       /* Initially, GC_free_space_divisor = 3.        */
-                       /* Increasing its value will use less space     */
-                       /* but more collection time.  Decreasing it     */
-                       /* will appreciably decrease collection time    */
-                       /* at the expense of space.                     */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                        /* We try to make sure that we allocate at      */
+                        /* least N/GC_free_space_divisor bytes between  */
+                        /* collections, where N is twice the number     */
+                        /* of traced bytes, plus the number of untraced */
+                        /* bytes (bytes in "atomic" objects), plus      */
+                        /* a rough estimate of the root set size.       */
+                        /* N approximates GC tracing work per GC.       */
+                        /* Initially, GC_free_space_divisor = 3.        */
+                        /* Increasing its value will use less space     */
+                        /* but more collection time.  Decreasing it     */
+                        /* will appreciably decrease collection time    */
+                        /* at the expense of space.                     */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_free_space_divisor(GC_word);
 GC_API GC_word GC_CALL GC_get_free_space_divisor(void);
 
 GC_API GC_word GC_max_retries;
-                       /* The maximum number of GCs attempted before   */
-                       /* reporting out of memory after heap           */
-                       /* expansion fails.  Initially 0.               */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+                        /* The maximum number of GCs attempted before   */
+                        /* reporting out of memory after heap           */
+                        /* expansion fails.  Initially 0.               */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_max_retries(GC_word);
 GC_API GC_word GC_CALL GC_get_max_retries(void);
-                       
-
-GC_API char *GC_stackbottom;    /* Cool end of user stack.             */
-                               /* May be set in the client prior to    */
-                               /* calling any GC_ routines.  This      */
-                               /* avoids some overhead, and            */
-                               /* potentially some signals that can    */
-                               /* confuse debuggers.  Otherwise the    */
-                               /* collector attempts to set it         */
-                               /* automatically.                       */
-                               /* For multithreaded code, this is the  */
-                               /* cold end of the stack for the        */
-                               /* primordial thread.                   */      
-                               
-GC_API int GC_dont_precollect;  /* Don't collect as part of            */
-                               /* initialization.  Should be set only  */
-                               /* if the client wants a chance to      */
-                               /* manually initialize the root set     */
-                               /* before the first collection.         */
-                               /* Interferes with blacklisting.        */
-                               /* Wizards only.                        */
-                       /* The setter and getter are unsynchronized, so */
-                       /* GC_call_with_alloc_lock() is required to     */
-                       /* avoid data races (if the value is modified   */
-                       /* after the GC is put to multi-threaded mode). */
+
+
+GC_API char *GC_stackbottom;    /* Cool end of user stack.              */
+                                /* May be set in the client prior to    */
+                                /* calling any GC_ routines.  This      */
+                                /* avoids some overhead, and            */
+                                /* potentially some signals that can    */
+                                /* confuse debuggers.  Otherwise the    */
+                                /* collector attempts to set it         */
+                                /* automatically.                       */
+                                /* For multithreaded code, this is the  */
+                                /* cold end of the stack for the        */
+                                /* primordial thread.                   */
+
+GC_API int GC_dont_precollect;  /* Don't collect as part of             */
+                                /* initialization.  Should be set only  */
+                                /* if the client wants a chance to      */
+                                /* manually initialize the root set     */
+                                /* before the first collection.         */
+                                /* Interferes with blacklisting.        */
+                                /* Wizards only.                        */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_dont_precollect(int);
 GC_API int GC_CALL GC_get_dont_precollect(void);
 
 GC_API unsigned long GC_time_limit;
-                               /* If incremental collection is enabled, */
-                               /* We try to terminate collections       */
-                               /* after this many milliseconds.  Not a  */
-                               /* hard time bound.  Setting this to     */
-                               /* GC_TIME_UNLIMITED will essentially    */
-                               /* disable incremental collection while  */
-                               /* leaving generational collection       */
-                               /* enabled.                              */
-#      define GC_TIME_UNLIMITED 999999
-                               /* Setting GC_time_limit to this value   */
-                               /* will disable the "pause time exceeded"*/
-                               /* tests.                                */
-                       /* The setter and getter are unsynchronized, so  */
-                       /* GC_call_with_alloc_lock() is required to      */
-                       /* avoid data races (if the value is modified    */
-                       /* after the GC is put to multi-threaded mode).  */
+                               /* If incremental collection is enabled, */
+                               /* We try to terminate collections       */
+                               /* after this many milliseconds.  Not a  */
+                               /* hard time bound.  Setting this to     */
+                               /* GC_TIME_UNLIMITED will essentially    */
+                               /* disable incremental collection while  */
+                               /* leaving generational collection       */
+                               /* enabled.                              */
+#       define GC_TIME_UNLIMITED 999999
+                               /* Setting GC_time_limit to this value   */
+                               /* will disable the "pause time exceeded"*/
+                               /* tests.                                */
+                        /* The setter and getter are unsynchronized, so */
+                        /* GC_call_with_alloc_lock() is required to     */
+                        /* avoid data races (if the value is modified   */
+                        /* after the GC is put to multi-threaded mode). */
 GC_API void GC_CALL GC_set_time_limit(unsigned long);
 GC_API unsigned long GC_CALL GC_get_time_limit(void);
 
 /* Public procedures */
 
-/* Initialize the collector.  Portable clients should call GC_INIT() from
- * the main program instead.
- */
+/* Initialize the collector.  Portable clients should call GC_INIT()    */
+/* from the main program instead.                                       */
 GC_API void GC_CALL GC_init(void);
 
-/*
- * general purpose allocation routines, with roughly malloc calling conv.
- * The atomic versions promise that no relevant pointers are contained
- * in the object.  The non-atomic versions guarantee that the new object
- * is cleared.  GC_malloc_stubborn promises that no changes to the object
- * will occur after GC_end_stubborn_change has been called on the
- * result of GC_malloc_stubborn. GC_malloc_uncollectable allocates an object
- * that is scanned for pointers to collectable objects, but is not itself
- * collectable.  The object is scanned even if it does not appear to
- * be reachable.  GC_malloc_uncollectable and GC_free called on the resulting
- * object implicitly update GC_non_gc_bytes appropriately.
- *
- * Note that the GC_malloc_stubborn support doesn't really
- * exist anymore.  MANUAL_VDB provides comparable functionality.
- */
+/* General purpose allocation routines, with roughly malloc calling     */
+/* conv.  The atomic versions promise that no relevant pointers are     */
+/* contained in the object.  The non-atomic versions guarantee that the */
+/* new object is cleared.  GC_malloc_stubborn promises that no changes  */
+/* to the object will occur after GC_end_stubborn_change has been       */
+/* called on the result of GC_malloc_stubborn.  GC_malloc_uncollectable */
+/* allocates an object that is scanned for pointers to collectable      */
+/* objects, but is not itself collectable.  The object is scanned even  */
+/* if it does not appear to be reachable.  GC_malloc_uncollectable and  */
+/* GC_free called on the resulting object implicitly update             */
+/* GC_non_gc_bytes appropriately.                                       */
+/* Note that the GC_malloc_stubborn support doesn't really exist        */
+/* anymore.  MANUAL_VDB provides comparable functionality.              */
 GC_API void * GC_CALL GC_malloc(size_t /* size_in_bytes */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_malloc_atomic(size_t /* size_in_bytes */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API char * GC_CALL GC_strdup(const char *) GC_ATTR_MALLOC;
 GC_API void * GC_CALL GC_malloc_uncollectable(size_t /* size_in_bytes */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_malloc_stubborn(size_t /* size_in_bytes */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 
-/* GC_memalign() is not well tested.   */
+/* GC_memalign() is not well tested.                                    */
 GC_API void * GC_CALL GC_memalign(size_t /* align */, size_t /* lb */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(2);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(2);
 
-/* The following is only defined if the library has been suitably      */
-/* compiled:                                                           */
+/* The following is only defined if the library has been suitably       */
+/* compiled:                                                            */
 GC_API void * GC_CALL GC_malloc_atomic_uncollectable(
-                                               size_t /* size_in_bytes */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                                                size_t /* size_in_bytes */)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 
 /* Explicitly deallocate an object.  Dangerous if used incorrectly.     */
-/* Requires a pointer to the base of an object.                                */
+/* Requires a pointer to the base of an object.                         */
 /* If the argument is stubborn, it should not be changeable when freed. */
-/* An object should not be enabled for finalization when it is         */
-/* explicitly deallocated.                                             */
-/* GC_free(0) is a no-op, as required by ANSI C for free.              */
+/* An object should not be enabled for finalization when it is          */
+/* explicitly deallocated.                                              */
+/* GC_free(0) is a no-op, as required by ANSI C for free.               */
 GC_API void GC_CALL GC_free(void *);
 
-/*
- * Stubborn objects may be changed only if the collector is explicitly informed.
- * The collector is implicitly informed of coming change when such
- * an object is first allocated.  The following routines inform the
- * collector that an object will no longer be changed, or that it will
- * once again be changed.  Only non-NULL pointer stores into the object
- * are considered to be changes.  The argument to GC_end_stubborn_change
- * must be exactly the value returned by GC_malloc_stubborn or passed to
- * GC_change_stubborn.  (In the second case it may be an interior pointer
- * within 512 bytes of the beginning of the objects.)
- * There is a performance penalty for allowing more than
- * one stubborn object to be changed at once, but it is acceptable to
- * do so.  The same applies to dropping stubborn objects that are still
- * changeable.
- */
+/* Stubborn objects may be changed only if the collector is explicitly  */
+/* informed.  The collector is implicitly informed of coming change     */
+/* when such an object is first allocated.  The following routines      */
+/* inform the collector that an object will no longer be changed, or    */
+/* that it will once again be changed.  Only non-NULL pointer stores    */
+/* into the object are considered to be changes.  The argument to       */
+/* GC_end_stubborn_change must be exactly the value returned by         */
+/* GC_malloc_stubborn or passed to GC_change_stubborn.  (In the second  */
+/* case, it may be an interior pointer within 512 bytes of the          */
+/* beginning of the objects.)  There is a performance penalty for       */
+/* allowing more than one stubborn object to be changed at once, but it */
+/* is acceptable to do so.  The same applies to dropping stubborn       */
+/* objects that are still changeable.                                   */
 GC_API void GC_CALL GC_change_stubborn(void *);
 GC_API void GC_CALL GC_end_stubborn_change(void *);
 
-/* Return a pointer to the base (lowest address) of an object given    */
-/* a pointer to a location within the object.                          */
-/* I.e. map an interior pointer to the corresponding bas pointer.      */
-/* Note that with debugging allocation, this returns a pointer to the  */
-/* actual base of the object, i.e. the debug information, not to       */
-/* the base of the user object.                                                */
-/* Return 0 if displaced_pointer doesn't point to within a valid       */
-/* object.                                                             */
-/* Note that a deallocated object in the garbage collected heap                */
-/* may be considered valid, even if it has been deallocated with       */
-/* GC_free.                                                            */
+/* Return a pointer to the base (lowest address) of an object given     */
+/* a pointer to a location within the object.                           */
+/* I.e. map an interior pointer to the corresponding bas pointer.       */
+/* Note that with debugging allocation, this returns a pointer to the   */
+/* actual base of the object, i.e. the debug information, not to        */
+/* the base of the user object.                                         */
+/* Return 0 if displaced_pointer doesn't point to within a valid        */
+/* object.                                                              */
+/* Note that a deallocated object in the garbage collected heap         */
+/* may be considered valid, even if it has been deallocated with        */
+/* GC_free.                                                             */
 GC_API void * GC_CALL GC_base(void * /* displaced_pointer */);
 
-/* Given a pointer to the base of an object, return its size in bytes. */
-/* The returned size may be slightly larger than what was originally   */
-/* requested.                                                          */
+/* Given a pointer to the base of an object, return its size in bytes.  */
+/* The returned size may be slightly larger than what was originally    */
+/* requested.                                                           */
 GC_API size_t GC_CALL GC_size(const void * /* object_addr */);
 
-/* For compatibility with C library.  This is occasionally faster than */
-/* a malloc followed by a bcopy.  But if you rely on that, either here */
-/* or with the standard C library, your code is broken.  In my         */
-/* opinion, it shouldn't have been invented, but now we're stuck. -HB  */
-/* The resulting object has the same kind as the original.             */
-/* If the argument is stubborn, the result will have changes enabled.  */
-/* It is an error to have changes enabled for the original object.     */
-/* Follows ANSI conventions for NULL old_object.                       */
+/* For compatibility with C library.  This is occasionally faster than  */
+/* a malloc followed by a bcopy.  But if you rely on that, either here  */
+/* or with the standard C library, your code is broken.  In my          */
+/* opinion, it shouldn't have been invented, but now we're stuck. -HB   */
+/* The resulting object has the same kind as the original.              */
+/* If the argument is stubborn, the result will have changes enabled.   */
+/* It is an error to have changes enabled for the original object.      */
+/* Follows ANSI conventions for NULL old_object.                        */
 GC_API void * GC_CALL GC_realloc(void * /* old_object */,
-                               size_t /* new_size_in_bytes */)
-                       /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);
-                                  
-/* Explicitly increase the heap size.  */
+                                size_t /* new_size_in_bytes */)
+                        /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);
+
+/* Explicitly increase the heap size.   */
 /* Returns 0 on failure, 1 on success.  */
 GC_API int GC_CALL GC_expand_hp(size_t /* number_of_bytes */);
 
-/* Limit the heap size to n bytes.  Useful when you're debugging,      */
-/* especially on systems that don't handle running out of memory well. */
-/* n == 0 ==> unbounded.  This is the default.                         */
+/* Limit the heap size to n bytes.  Useful when you're debugging,       */
+/* especially on systems that don't handle running out of memory well.  */
+/* n == 0 ==> unbounded.  This is the default.                          */
 GC_API void GC_CALL GC_set_max_heap_size(GC_word /* n */);
 
-/* Inform the collector that a certain section of statically allocated */
-/* memory contains no pointers to garbage collected memory.  Thus it   */
+/* Inform the collector that a certain section of statically allocated  */
+/* memory contains no pointers to garbage collected memory.  Thus it    */
 /* need not be scanned.  This is sometimes important if the application */
-/* maps large read/write files into the address space, which could be  */
-/* mistaken for dynamic library data segments on some systems.         */
-/* The section (referred to by low_address) must be pointer-aligned.   */
-/* low_address must not be greater than high_address_plus_1.           */
+/* maps large read/write files into the address space, which could be   */
+/* mistaken for dynamic library data segments on some systems.          */
+/* The section (referred to by low_address) must be pointer-aligned.    */
+/* low_address must not be greater than high_address_plus_1.            */
 GC_API void GC_CALL GC_exclude_static_roots(void * /* low_address */,
-                                       void * /* high_address_plus_1 */);
+                                        void * /* high_address_plus_1 */);
 
-/* Clear the set of root segments.  Wizards only. */
+/* Clear the set of root segments.  Wizards only.                       */
 GC_API void GC_CALL GC_clear_roots(void);
 
-/* Add a root segment.  Wizards only. */
-/* The segment (referred to by low_address) must be pointer-aligned.   */
-/* low_address must not be greater than high_address_plus_1.           */
+/* Add a root segment.  Wizards only.                                   */
+/* The segment (referred to by low_address) must be pointer-aligned.    */
+/* low_address must not be greater than high_address_plus_1.            */
 GC_API void GC_CALL GC_add_roots(void * /* low_address */,
-                               void * /* high_address_plus_1 */);
+                                void * /* high_address_plus_1 */);
 
-/* Remove a root segment.  Wizards only. */
-/* May be unimplemented on some platforms.     */
+/* Remove a root segment.  Wizards only.                                */
+/* May be unimplemented on some platforms.                              */
 GC_API void GC_CALL GC_remove_roots(void * /* low_address */,
-                               void * /* high_address_plus_1 */);
+                                void * /* high_address_plus_1 */);
 
-/* Add a displacement to the set of those considered valid by the      */
+/* Add a displacement to the set of those considered valid by the       */
 /* collector.  GC_register_displacement(n) means that if p was returned */
-/* by GC_malloc, then (char *)p + n will be considered to be a valid   */
-/* pointer to p.  N must be small and less than the size of p.         */
-/* (All pointers to the interior of objects from the stack are         */
-/* considered valid in any case.  This applies to heap objects and     */
-/* static data.)                                                       */
-/* Preferably, this should be called before any other GC procedures.   */
-/* Calling it later adds to the probability of excess memory           */
-/* retention.                                                          */
-/* This is a no-op if the collector has recognition of                 */
-/* arbitrary interior pointers enabled, which is now the default.      */
+/* by GC_malloc, then (char *)p + n will be considered to be a valid    */
+/* pointer to p.  N must be small and less than the size of p.          */
+/* (All pointers to the interior of objects from the stack are          */
+/* considered valid in any case.  This applies to heap objects and      */
+/* static data.)                                                        */
+/* Preferably, this should be called before any other GC procedures.    */
+/* Calling it later adds to the probability of excess memory            */
+/* retention.                                                           */
+/* This is a no-op if the collector has recognition of                  */
+/* arbitrary interior pointers enabled, which is now the default.       */
 GC_API void GC_CALL GC_register_displacement(size_t /* n */);
 
-/* The following version should be used if any debugging allocation is */
-/* being done.                                                         */
+/* The following version should be used if any debugging allocation is  */
+/* being done.                                                          */
 GC_API void GC_CALL GC_debug_register_displacement(size_t /* n */);
 
-/* Explicitly trigger a full, world-stop collection.   */
+/* Explicitly trigger a full, world-stop collection.    */
 GC_API void GC_CALL GC_gcollect(void);
 
-/* Trigger a full world-stopped collection.  Abort the collection if   */
-/* and when stop_func returns a nonzero value.  Stop_func will be      */
-/* called frequently, and should be reasonably fast.  This works even  */
-/* if virtual dirty bits, and hence incremental collection is not      */
-/* available for this architecture.  Collections can be aborted faster */
-/* than normal pause times for incremental collection.  However,       */
-/* aborted collections do no useful work; the next collection needs    */
-/* to start from the beginning.         stop_func must not be 0.               */
-/* Return 0 if the collection was aborted, 1 if it succeeded.          */
+/* Trigger a full world-stopped collection.  Abort the collection if    */
+/* and when stop_func returns a nonzero value.  Stop_func will be       */
+/* called frequently, and should be reasonably fast.  This works even   */
+/* if virtual dirty bits, and hence incremental collection is not       */
+/* available for this architecture.  Collections can be aborted faster  */
+/* than normal pause times for incremental collection.  However,        */
+/* aborted collections do no useful work; the next collection needs     */
+/* to start from the beginning.  stop_func must not be 0.               */
+/* Return 0 if the collection was aborted, 1 if it succeeded.           */
 typedef int (GC_CALLBACK * GC_stop_func)(void);
 GC_API int GC_CALL GC_try_to_collect(GC_stop_func /* stop_func */);
 
-/* Set and get the default stop_func.  The default stop_func is used by        */
-/* GC_gcollect() and by implicitly trigged collections (except for the */
-/* case when handling out of memory).  Must not be 0.                  */
+/* Set and get the default stop_func.  The default stop_func is used by */
+/* GC_gcollect() and by implicitly trigged collections (except for the  */
+/* case when handling out of memory).  Must not be 0.                   */
 GC_API void GC_CALL GC_set_stop_func(GC_stop_func /* stop_func */);
 GC_API GC_stop_func GC_CALL GC_get_stop_func(void);
 
-/* Return the number of bytes in the heap.  Excludes collector private */
-/* data structures.  Excludes the unmapped memory (retuned to the OS). */
-/* Includes empty blocks and fragmentation loss.  Includes some pages  */
-/* that were allocated but never written.                              */
+/* Return the number of bytes in the heap.  Excludes collector private  */
+/* data structures.  Excludes the unmapped memory (retuned to the OS).  */
+/* Includes empty blocks and fragmentation loss.  Includes some pages   */
+/* that were allocated but never written.                               */
 GC_API size_t GC_CALL GC_get_heap_size(void);
 
-/* Return a lower bound on the number of free bytes in the heap                */
-/* (excluding the unmapped memory space).                              */
+/* Return a lower bound on the number of free bytes in the heap         */
+/* (excluding the unmapped memory space).                               */
 GC_API size_t GC_CALL GC_get_free_bytes(void);
 
-/* Return the size (in bytes) of the unmapped memory (which is returned        */
-/* to the OS but could be remapped back by the collector later unless  */
-/* the OS runs out of system/virtual memory).                          */
+/* Return the size (in bytes) of the unmapped memory (which is returned */
+/* to the OS but could be remapped back by the collector later unless   */
+/* the OS runs out of system/virtual memory).                           */
 GC_API size_t GC_CALL GC_get_unmapped_bytes(void);
 
-/* Return the number of bytes allocated since the last collection.     */
+/* Return the number of bytes allocated since the last collection.      */
 GC_API size_t GC_CALL GC_get_bytes_since_gc(void);
 
-/* Return the total number of bytes allocated in this process.         */
-/* Never decreases, except due to wrapping.                            */
+/* Return the total number of bytes allocated in this process.          */
+/* Never decreases, except due to wrapping.                             */
 GC_API size_t GC_CALL GC_get_total_bytes(void);
 
-/* Disable garbage collection.  Even GC_gcollect calls will be                 */
-/* ineffective.                                                                */
+/* Disable garbage collection.  Even GC_gcollect calls will be          */
+/* ineffective.                                                         */
 GC_API void GC_CALL GC_disable(void);
 
-/* Re-enable garbage collection.  GC_disable() and GC_enable() calls   */
-/* nest.  Garbage collection is enabled if the number of calls to both */
-/* both functions is equal.                                            */
+/* Re-enable garbage collection.  GC_disable() and GC_enable() calls    */
+/* nest.  Garbage collection is enabled if the number of calls to both  */
+/* both functions is equal.                                             */
 GC_API void GC_CALL GC_enable(void);
 
-/* Enable incremental/generational collection. */
-/* Not advisable unless dirty bits are                 */
-/* available or most heap objects are          */
-/* pointer-free (atomic) or immutable.         */
-/* Don't use in leak finding mode.             */
-/* Ignored if GC_dont_gc is true.              */
-/* Only the generational piece of this is      */
-/* functional if GC_parallel is TRUE           */
-/* or if GC_time_limit is GC_TIME_UNLIMITED.   */
-/* Causes thread-local variant of GC_gcj_malloc() to revert to */
-/* locked allocation.  Must be called before any such          */
-/* GC_gcj_malloc() calls.                                      */
-/* For best performance, should be called as early as possible.        */
-/* On some platforms, calling it later may have adverse effects.*/
-/* Safe to call before GC_INIT().  Includes a GC_init() call.  */
+/* Enable incremental/generational collection.  Not advisable unless    */
+/* dirty bits are available or most heap objects are pointer-free       */
+/* (atomic) or immutable.  Don't use in leak finding mode.  Ignored if  */
+/* GC_dont_gc is true.  Only the generational piece of this is          */
+/* functional if GC_parallel is TRUE or if GC_time_limit is             */
+/* GC_TIME_UNLIMITED.  Causes thread-local variant of GC_gcj_malloc()   */
+/* to revert to locked allocation.  Must be called before any such      */
+/* GC_gcj_malloc() calls.  For best performance, should be called as    */
+/* early as possible.  On some platforms, calling it later may have     */
+/* adverse effects.                                                     */
+/* Safe to call before GC_INIT().  Includes a  GC_init() call.          */
 GC_API void GC_CALL GC_enable_incremental(void);
 
-/* Does incremental mode write-protect pages?  Returns zero or */
-/* more of the following, or'ed together:                      */
-#define GC_PROTECTS_POINTER_HEAP  1 /* May protect non-atomic objs.    */
+/* Does incremental mode write-protect pages?  Returns zero or  */
+/* more of the following, or'ed together:                       */
+#define GC_PROTECTS_POINTER_HEAP  1 /* May protect non-atomic objs.     */
 #define GC_PROTECTS_PTRFREE_HEAP  2
-#define GC_PROTECTS_STATIC_DATA   4 /* Currently never.                        */
-#define GC_PROTECTS_STACK        8 /* Probably impractical.            */
+#define GC_PROTECTS_STATIC_DATA   4 /* Currently never.                 */
+#define GC_PROTECTS_STACK         8 /* Probably impractical.            */
 
 #define GC_PROTECTS_NONE 0
 GC_API int GC_CALL GC_incremental_protection_needs(void);
 
-/* Perform some garbage collection work, if appropriate.       */
-/* Return 0 if there is no more work to be done.               */
-/* Typically performs an amount of work corresponding roughly  */
-/* to marking from one page.  May do more work if further      */
-/* progress requires it, e.g. if incremental collection is     */
-/* disabled.  It is reasonable to call this in a wait loop     */
-/* until it returns 0.                                         */
+/* Perform some garbage collection work, if appropriate.        */
+/* Return 0 if there is no more work to be done.                */
+/* Typically performs an amount of work corresponding roughly   */
+/* to marking from one page.  May do more work if further       */
+/* progress requires it, e.g. if incremental collection is      */
+/* disabled.  It is reasonable to call this in a wait loop      */
+/* until it returns 0.                                          */
 GC_API int GC_CALL GC_collect_a_little(void);
 
-/* Allocate an object of size lb bytes.  The client guarantees that    */
-/* as long as the object is live, it will be referenced by a pointer   */
-/* that points to somewhere within the first 256 bytes of the object.  */
-/* (This should normally be declared volatile to prevent the compiler  */
-/* from invalidating this assertion.)  This routine is only useful     */
-/* if a large array is being allocated.  It reduces the chance of      */
-/* accidentally retaining such an array as a result of scanning an     */
-/* integer that happens to be an address inside the array.  (Actually, */
-/* it reduces the chance of the allocator not finding space for such   */
-/* an array, since it will try hard to avoid introducing such a false  */
+/* Allocate an object of size lb bytes.  The client guarantees that     */
+/* as long as the object is live, it will be referenced by a pointer    */
+/* that points to somewhere within the first 256 bytes of the object.   */
+/* (This should normally be declared volatile to prevent the compiler   */
+/* from invalidating this assertion.)  This routine is only useful      */
+/* if a large array is being allocated.  It reduces the chance of       */
+/* accidentally retaining such an array as a result of scanning an      */
+/* integer that happens to be an address inside the array.  (Actually,  */
+/* it reduces the chance of the allocator not finding space for such    */
+/* an array, since it will try hard to avoid introducing such a false   */
 /* reference.)  On a SunOS 4.X or MS Windows system this is recommended */
-/* for arrays likely to be larger than 100K or so.  For other systems, */
-/* or if the collector is not configured to recognize all interior     */
-/* pointers, the threshold is normally much higher.                    */
+/* for arrays likely to be larger than 100K or so.  For other systems,  */
+/* or if the collector is not configured to recognize all interior      */
+/* pointers, the threshold is normally much higher.                     */
 GC_API void * GC_CALL GC_malloc_ignore_off_page(size_t /* lb */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_malloc_atomic_ignore_off_page(size_t /* lb */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 
 #if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION >= 720
 #   define GC_ADD_CALLER
@@ -596,9 +588,9 @@ GC_API void * GC_CALL GC_malloc_atomic_ignore_off_page(size_t /* lb */)
 # endif
 #endif
 
-#if defined(_MSC_VER) && _MSC_VER >= 1200 /* version 12.0+ (MSVC 6.0+)  */ \
-       && !defined(_AMD64_) && !defined(GC_HAVE_NO_BUILTIN_BACKTRACE) \
-       && !defined(_WIN32_WCE) && !defined(GC_HAVE_BUILTIN_BACKTRACE)
+#if defined(_MSC_VER) && _MSC_VER >= 1200 /* version 12.0+ (MSVC 6.0+) */ \
+        && !defined(_AMD64_) && !defined(GC_HAVE_NO_BUILTIN_BACKTRACE) \
+        && !defined(_WIN32_WCE) && !defined(GC_HAVE_BUILTIN_BACKTRACE)
 # define GC_HAVE_BUILTIN_BACKTRACE
 #endif
 
@@ -610,19 +602,20 @@ GC_API void * GC_CALL GC_malloc_atomic_ignore_off_page(size_t /* lb */)
 #   define GC_CAN_SAVE_CALL_STACKS
 #endif
 
-/* If we're on an a platform on which we can't save call stacks, but   */
-/* gcc is normally used, we go ahead and define GC_ADD_CALLER.         */
-/* We make this decision independent of whether gcc is actually being  */
-/* used, in order to keep the interface consistent, and allow mixing   */
-/* of compilers.                                                       */
-/* This may also be desirable if it is possible but expensive to       */
-/* retrieve the call chain.                                            */
+/* If we're on an a platform on which we can't save call stacks, but    */
+/* gcc is normally used, we go ahead and define GC_ADD_CALLER.          */
+/* We make this decision independent of whether gcc is actually being   */
+/* used, in order to keep the interface consistent, and allow mixing    */
+/* of compilers.                                                        */
+/* This may also be desirable if it is possible but expensive to        */
+/* retrieve the call chain.                                             */
 #if (defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) \
-     || defined(__FreeBSD__) || defined(__DragonFly__)) & !defined(GC_CAN_SAVE_CALL_STACKS)
+     || defined(__FreeBSD__) || defined(__DragonFly__)) \
+    && !defined(GC_CAN_SAVE_CALL_STACKS)
 # define GC_ADD_CALLER
-# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) 
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
     /* gcc knows how to retrieve return address, but we don't know */
-    /* how to generate call stacks.                               */
+    /* how to generate call stacks.                                */
 #   define GC_RETURN_ADDR (GC_word)__builtin_return_address(0)
 # else
     /* Just pass 0 for gcc compatibility. */
@@ -638,78 +631,78 @@ GC_API void * GC_CALL GC_malloc_atomic_ignore_off_page(size_t /* lb */)
 #  define GC_EXTRA_PARAMS const char * s, int i
 #endif
 
-/* Debugging (annotated) allocation.  GC_gcollect will check           */
-/* objects allocated in this way for overwrites, etc.                  */
+/* Debugging (annotated) allocation.  GC_gcollect will check            */
+/* objects allocated in this way for overwrites, etc.                   */
 GC_API void * GC_CALL GC_debug_malloc(size_t /* size_in_bytes */,
-                                       GC_EXTRA_PARAMS)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                                        GC_EXTRA_PARAMS)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_debug_malloc_atomic(size_t /* size_in_bytes */,
-                                       GC_EXTRA_PARAMS)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                                        GC_EXTRA_PARAMS)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API char * GC_CALL GC_debug_strdup(const char *,
-                                       GC_EXTRA_PARAMS) GC_ATTR_MALLOC;
+                                        GC_EXTRA_PARAMS) GC_ATTR_MALLOC;
 GC_API void * GC_CALL GC_debug_malloc_uncollectable
-                       (size_t /* size_in_bytes */, GC_EXTRA_PARAMS)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        (size_t /* size_in_bytes */, GC_EXTRA_PARAMS)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_debug_malloc_stubborn(size_t /* size_in_bytes */,
-                                       GC_EXTRA_PARAMS)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                                        GC_EXTRA_PARAMS)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_debug_malloc_ignore_off_page
-       (size_t /* size_in_bytes */, GC_EXTRA_PARAMS)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+        (size_t /* size_in_bytes */, GC_EXTRA_PARAMS)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page
-                       (size_t /* size_in_bytes */, GC_EXTRA_PARAMS)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        (size_t /* size_in_bytes */, GC_EXTRA_PARAMS)
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void GC_CALL GC_debug_free(void *);
 GC_API void * GC_CALL GC_debug_realloc(void * /* old_object */,
-                       size_t /* new_size_in_bytes */, GC_EXTRA_PARAMS)
-                       /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);
+                        size_t /* new_size_in_bytes */, GC_EXTRA_PARAMS)
+                        /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);
 GC_API void GC_CALL GC_debug_change_stubborn(void *);
 GC_API void GC_CALL GC_debug_end_stubborn_change(void *);
 
-/* Routines that allocate objects with debug information (like the     */
-/* above), but just fill in dummy file and line number information.    */
-/* Thus they can serve as drop-in malloc/realloc replacements.  This   */
-/* can be useful for two reasons:                                      */
-/* 1) It allows the collector to be built with DBG_HDRS_ALL defined    */
-/*    even if some allocation calls come from 3rd party libraries      */
-/*    that can't be recompiled.                                                */
-/* 2) On some platforms, the file and line information is redundant,   */
-/*    since it can be reconstructed from a stack trace.  On such       */
-/*    platforms it may be more convenient not to recompile, e.g. for   */
-/*    leak detection.  This can be accomplished by instructing the     */
-/*    linker to replace malloc/realloc with these.                     */
+/* Routines that allocate objects with debug information (like the      */
+/* above), but just fill in dummy file and line number information.     */
+/* Thus they can serve as drop-in malloc/realloc replacements.  This    */
+/* can be useful for two reasons:                                       */
+/* 1) It allows the collector to be built with DBG_HDRS_ALL defined     */
+/*    even if some allocation calls come from 3rd party libraries       */
+/*    that can't be recompiled.                                         */
+/* 2) On some platforms, the file and line information is redundant,    */
+/*    since it can be reconstructed from a stack trace.  On such        */
+/*    platforms it may be more convenient not to recompile, e.g. for    */
+/*    leak detection.  This can be accomplished by instructing the      */
+/*    linker to replace malloc/realloc with these.                      */
 GC_API void * GC_CALL GC_debug_malloc_replacement(size_t /* size_in_bytes */)
-                       GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
+                        GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1);
 GC_API void * GC_CALL GC_debug_realloc_replacement(void * /* object_addr */,
-                                               size_t /* size_in_bytes */)
-                       /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);
-                                
+                                                size_t /* size_in_bytes */)
+                        /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);
+
 # ifdef GC_DEBUG
 #   define GC_MALLOC(sz) GC_debug_malloc(sz, GC_EXTRAS)
 #   define GC_MALLOC_ATOMIC(sz) GC_debug_malloc_atomic(sz, GC_EXTRAS)
 #   define GC_STRDUP(s) GC_debug_strdup((s), GC_EXTRAS)
 #   define GC_MALLOC_UNCOLLECTABLE(sz) \
-                       GC_debug_malloc_uncollectable(sz, GC_EXTRAS)
+                        GC_debug_malloc_uncollectable(sz, GC_EXTRAS)
 #   define GC_MALLOC_IGNORE_OFF_PAGE(sz) \
-                       GC_debug_malloc_ignore_off_page(sz, GC_EXTRAS)
+                        GC_debug_malloc_ignore_off_page(sz, GC_EXTRAS)
 #   define GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(sz) \
-                       GC_debug_malloc_atomic_ignore_off_page(sz, GC_EXTRAS)
+                        GC_debug_malloc_atomic_ignore_off_page(sz, GC_EXTRAS)
 #   define GC_REALLOC(old, sz) GC_debug_realloc(old, sz, GC_EXTRAS)
 #   define GC_FREE(p) GC_debug_free(p)
 #   define GC_REGISTER_FINALIZER(p, f, d, of, od) \
-       GC_debug_register_finalizer(p, f, d, of, od)
+        GC_debug_register_finalizer(p, f, d, of, od)
 #   define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \
-       GC_debug_register_finalizer_ignore_self(p, f, d, of, od)
+        GC_debug_register_finalizer_ignore_self(p, f, d, of, od)
 #   define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \
-       GC_debug_register_finalizer_no_order(p, f, d, of, od)
+        GC_debug_register_finalizer_no_order(p, f, d, of, od)
 #   define GC_REGISTER_FINALIZER_UNREACHABLE(p, f, d, of, od) \
-       GC_debug_register_finalizer_unreachable(p, f, d, of, od)
+        GC_debug_register_finalizer_unreachable(p, f, d, of, od)
 #   define GC_MALLOC_STUBBORN(sz) GC_debug_malloc_stubborn(sz, GC_EXTRAS);
 #   define GC_CHANGE_STUBBORN(p) GC_debug_change_stubborn(p)
 #   define GC_END_STUBBORN_CHANGE(p) GC_debug_end_stubborn_change(p)
 #   define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \
-       GC_general_register_disappearing_link(link, GC_base(obj))
+        GC_general_register_disappearing_link(link, GC_base(obj))
 #   define GC_REGISTER_DISPLACEMENT(n) GC_debug_register_displacement(n)
 # else
 #   define GC_MALLOC(sz) GC_malloc(sz)
@@ -717,228 +710,228 @@ GC_API void * GC_CALL GC_debug_realloc_replacement(void * /* object_addr */,
 #   define GC_STRDUP(s) GC_strdup(s)
 #   define GC_MALLOC_UNCOLLECTABLE(sz) GC_malloc_uncollectable(sz)
 #   define GC_MALLOC_IGNORE_OFF_PAGE(sz) \
-                       GC_malloc_ignore_off_page(sz)
+                        GC_malloc_ignore_off_page(sz)
 #   define GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(sz) \
-                       GC_malloc_atomic_ignore_off_page(sz)
+                        GC_malloc_atomic_ignore_off_page(sz)
 #   define GC_REALLOC(old, sz) GC_realloc(old, sz)
 #   define GC_FREE(p) GC_free(p)
 #   define GC_REGISTER_FINALIZER(p, f, d, of, od) \
-       GC_register_finalizer(p, f, d, of, od)
+        GC_register_finalizer(p, f, d, of, od)
 #   define GC_REGISTER_FINALIZER_IGNORE_SELF(p, f, d, of, od) \
-       GC_register_finalizer_ignore_self(p, f, d, of, od)
+        GC_register_finalizer_ignore_self(p, f, d, of, od)
 #   define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \
-       GC_register_finalizer_no_order(p, f, d, of, od)
+        GC_register_finalizer_no_order(p, f, d, of, od)
 #   define GC_REGISTER_FINALIZER_UNREACHABLE(p, f, d, of, od) \
-       GC_register_finalizer_unreachable(p, f, d, of, od)
+        GC_register_finalizer_unreachable(p, f, d, of, od)
 #   define GC_MALLOC_STUBBORN(sz) GC_malloc_stubborn(sz)
 #   define GC_CHANGE_STUBBORN(p) GC_change_stubborn(p)
 #   define GC_END_STUBBORN_CHANGE(p) GC_end_stubborn_change(p)
 #   define GC_GENERAL_REGISTER_DISAPPEARING_LINK(link, obj) \
-       GC_general_register_disappearing_link(link, obj)
+        GC_general_register_disappearing_link(link, obj)
 #   define GC_REGISTER_DISPLACEMENT(n) GC_register_displacement(n)
 # endif
-/* The following are included because they are often convenient, and   */
-/* reduce the chance for a misspecified size argument.  But calls may  */
-/* expand to something syntactically incorrect if t is a complicated   */
-/* type expression.                                                    */
+/* The following are included because they are often convenient, and    */
+/* reduce the chance for a misspecified size argument.  But calls may   */
+/* expand to something syntactically incorrect if t is a complicated    */
+/* type expression.                                                     */
 # define GC_NEW(t) (t *)GC_MALLOC(sizeof (t))
 # define GC_NEW_ATOMIC(t) (t *)GC_MALLOC_ATOMIC(sizeof (t))
 # define GC_NEW_STUBBORN(t) (t *)GC_MALLOC_STUBBORN(sizeof (t))
 # define GC_NEW_UNCOLLECTABLE(t) (t *)GC_MALLOC_UNCOLLECTABLE(sizeof (t))
 
-/* Finalization.  Some of these primitives are grossly unsafe.         */
-/* The idea is to make them both cheap, and sufficient to build                */
-/* a safer layer, closer to Modula-3, Java, or PCedar finalization.    */
-/* The interface represents my conclusions from a long discussion      */
-/* with Alan Demers, Dan Greene, Carl Hauser, Barry Hayes,             */
-/* Christian Jacobi, and Russ Atkinson.  It's not perfect, and         */
-/* probably nobody else agrees with it.            Hans-J. Boehm  3/13/92      */
+/* Finalization.  Some of these primitives are grossly unsafe.          */
+/* The idea is to make them both cheap, and sufficient to build         */
+/* a safer layer, closer to Modula-3, Java, or PCedar finalization.     */
+/* The interface represents my conclusions from a long discussion       */
+/* with Alan Demers, Dan Greene, Carl Hauser, Barry Hayes,              */
+/* Christian Jacobi, and Russ Atkinson.  It's not perfect, and          */
+/* probably nobody else agrees with it.     Hans-J. Boehm  3/13/92      */
 typedef void (GC_CALLBACK * GC_finalization_proc)(void * /* obj */,
-                                               void * /* client_data */);
+                                                void * /* client_data */);
 
 GC_API void GC_CALL GC_register_finalizer(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
 GC_API void GC_CALL GC_debug_register_finalizer(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
-       /* When obj is no longer accessible, invoke             */
-       /* (*fn)(obj, cd).  If a and b are inaccessible, and    */
-       /* a points to b (after disappearing links have been    */
-       /* made to disappear), then only a will be              */
-       /* finalized.  (If this does not create any new         */
-       /* pointers to b, then b will be finalized after the    */
-       /* next collection.)  Any finalizable object that       */
-       /* is reachable from itself by following one or more    */
-       /* pointers will not be finalized (or collected).       */
-       /* Thus cycles involving finalizable objects should     */
-       /* be avoided, or broken by disappearing links.         */
-       /* All but the last finalizer registered for an object  */
-       /* is ignored.                                          */
-       /* Finalization may be removed by passing 0 as fn.      */
-       /* Finalizers are implicitly unregistered when they are */
-       /* enqueued for finalization (i.e. become ready to be   */
-       /* finalized).                                          */
-       /* The old finalizer and client data are stored in      */
-       /* *ofn and *ocd.  (ofn and/or ocd may be NULL.         */
-       /* The allocation lock is held while *ofn and *ocd are  */
-       /* updated.  In case of error (no memory to register    */
-       /* new finalizer), *ofn and *ocd remain unchanged.)     */
-       /* Fn is never invoked on an accessible object,         */
-       /* provided hidden pointers are converted to real       */
-       /* pointers only if the allocation lock is held, and    */
-       /* such conversions are not performed by finalization   */
-       /* routines.                                            */
-       /* If GC_register_finalizer is aborted as a result of   */
-       /* a signal, the object may be left with no             */
-       /* finalization, even if neither the old nor new        */
-       /* finalizer were NULL.                                 */
-       /* Obj should be the starting address of an object      */
-       /* allocated by GC_malloc or friends. Obj may also be   */
-       /* NULL or point to something outside GC heap (in this  */
-       /* case, fn is ignored, *ofn and *ocd are set to NULL). */
-       /* Note that any garbage collectable object referenced  */
-       /* by cd will be considered accessible until the        */
-       /* finalizer is invoked.                                */
-
-/* Another versions of the above follow.  It ignores           */
-/* self-cycles, i.e. pointers from a finalizable object to     */
-/* itself.  There is a stylistic argument that this is wrong,  */
-/* but it's unavoidable for C++, since the compiler may                */
-/* silently introduce these.  It's also benign in that specific        */
-/* case.  And it helps if finalizable objects are split to     */
-/* avoid cycles.                                               */
-/* Note that cd will still be viewed as accessible, even if it */
-/* refers to the object itself.                                        */
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
+        /* When obj is no longer accessible, invoke             */
+        /* (*fn)(obj, cd).  If a and b are inaccessible, and    */
+        /* a points to b (after disappearing links have been    */
+        /* made to disappear), then only a will be              */
+        /* finalized.  (If this does not create any new         */
+        /* pointers to b, then b will be finalized after the    */
+        /* next collection.)  Any finalizable object that       */
+        /* is reachable from itself by following one or more    */
+        /* pointers will not be finalized (or collected).       */
+        /* Thus cycles involving finalizable objects should     */
+        /* be avoided, or broken by disappearing links.         */
+        /* All but the last finalizer registered for an object  */
+        /* is ignored.                                          */
+        /* Finalization may be removed by passing 0 as fn.      */
+        /* Finalizers are implicitly unregistered when they are */
+        /* enqueued for finalization (i.e. become ready to be   */
+        /* finalized).                                          */
+        /* The old finalizer and client data are stored in      */
+        /* *ofn and *ocd.  (ofn and/or ocd may be NULL.         */
+        /* The allocation lock is held while *ofn and *ocd are  */
+        /* updated.  In case of error (no memory to register    */
+        /* new finalizer), *ofn and *ocd remain unchanged.)     */
+        /* Fn is never invoked on an accessible object,         */
+        /* provided hidden pointers are converted to real       */
+        /* pointers only if the allocation lock is held, and    */
+        /* such conversions are not performed by finalization   */
+        /* routines.                                            */
+        /* If GC_register_finalizer is aborted as a result of   */
+        /* a signal, the object may be left with no             */
+        /* finalization, even if neither the old nor new        */
+        /* finalizer were NULL.                                 */
+        /* Obj should be the starting address of an object      */
+        /* allocated by GC_malloc or friends. Obj may also be   */
+        /* NULL or point to something outside GC heap (in this  */
+        /* case, fn is ignored, *ofn and *ocd are set to NULL). */
+        /* Note that any garbage collectable object referenced  */
+        /* by cd will be considered accessible until the        */
+        /* finalizer is invoked.                                */
+
+/* Another versions of the above follow.  It ignores            */
+/* self-cycles, i.e. pointers from a finalizable object to      */
+/* itself.  There is a stylistic argument that this is wrong,   */
+/* but it's unavoidable for C++, since the compiler may         */
+/* silently introduce these.  It's also benign in that specific */
+/* case.  And it helps if finalizable objects are split to      */
+/* avoid cycles.                                                */
+/* Note that cd will still be viewed as accessible, even if it  */
+/* refers to the object itself.                                 */
 GC_API void GC_CALL GC_register_finalizer_ignore_self(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
 GC_API void GC_CALL GC_debug_register_finalizer_ignore_self(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
 
 /* Another version of the above.  It ignores all cycles.        */
 /* It should probably only be used by Java implementations.     */
-/* Note that cd will still be viewed as accessible, even if it */
-/* refers to the object itself.                                        */
+/* Note that cd will still be viewed as accessible, even if it  */
+/* refers to the object itself.                                 */
 GC_API void GC_CALL GC_register_finalizer_no_order(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
 GC_API void GC_CALL GC_debug_register_finalizer_no_order(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
 
 /* This is a special finalizer that is useful when an object's  */
 /* finalizer must be run when the object is known to be no      */
 /* longer reachable, not even from other finalizable objects.   */
-/* It behaves like "normal" finalization, except that the      */
-/* finalizer is not run while the object is reachable from     */
-/* other objects specifying unordered finalization.            */
-/* Effectively it allows an object referenced, possibly                */
+/* It behaves like "normal" finalization, except that the       */
+/* finalizer is not run while the object is reachable from      */
+/* other objects specifying unordered finalization.             */
+/* Effectively it allows an object referenced, possibly         */
 /* indirectly, from an unordered finalizable object to override */
-/* the unordered finalization request.                         */
+/* the unordered finalization request.                          */
 /* This can be used in combination with finalizer_no_order so   */
 /* as to release resources that must not be released while an   */
 /* object can still be brought back to life by other            */
 /* finalizers.                                                  */
-/* Only works if GC_java_finalization is set.  Probably only   */
-/* of interest when implementing a language that requires      */
-/* unordered finalization (e.g. Java, C#).                     */
+/* Only works if GC_java_finalization is set.  Probably only    */
+/* of interest when implementing a language that requires       */
+/* unordered finalization (e.g. Java, C#).                      */
 GC_API void GC_CALL GC_register_finalizer_unreachable(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
 GC_API void GC_CALL GC_debug_register_finalizer_unreachable(void * /* obj */,
-                       GC_finalization_proc /* fn */, void * /* cd */,
-                       GC_finalization_proc * /* ofn */, void ** /* ocd */);
-
-#define GC_NO_MEMORY 2 /* Failure due to lack of memory.       */
-
-/* The following routine may be used to break cycles between   */
-/* finalizable objects, thus causing cyclic finalizable                */
-/* objects to be finalized in the correct order.  Standard     */
-/* use involves calling GC_register_disappearing_link(&p),     */
-/* where p is a pointer that is not followed by finalization   */
-/* code, and should not be considered in determining           */
-/* finalization order.                                         */
+                        GC_finalization_proc /* fn */, void * /* cd */,
+                        GC_finalization_proc * /* ofn */, void ** /* ocd */);
+
+#define GC_NO_MEMORY 2  /* Failure due to lack of memory.       */
+
+/* The following routine may be used to break cycles between    */
+/* finalizable objects, thus causing cyclic finalizable         */
+/* objects to be finalized in the correct order.  Standard      */
+/* use involves calling GC_register_disappearing_link(&p),      */
+/* where p is a pointer that is not followed by finalization    */
+/* code, and should not be considered in determining            */
+/* finalization order.                                          */
 GC_API int GC_CALL GC_register_disappearing_link(void ** /* link */);
-       /* Link should point to a field of a heap allocated     */
-       /* object obj.  *link will be cleared when obj is       */
-       /* found to be inaccessible.  This happens BEFORE any   */
-       /* finalization code is invoked, and BEFORE any         */
-       /* decisions about finalization order are made.         */
-       /* This is useful in telling the finalizer that         */
-       /* some pointers are not essential for proper           */
-       /* finalization.  This may avoid finalization cycles.   */
-       /* Note that obj may be resurrected by another          */
-       /* finalizer, and thus the clearing of *link may        */
-       /* be visible to non-finalization code.                 */
-       /* There's an argument that an arbitrary action should  */
-       /* be allowed here, instead of just clearing a pointer. */
-       /* But this causes problems if that action alters, or   */
-       /* examines connectivity.  Returns GC_DUPLICATE if link */
-       /* was already registered, GC_SUCCESS if registration   */
-       /* succeeded, GC_NO_MEMORY if it failed for lack of     */
-       /* memory, and GC_oom_fn did not handle the problem.    */
-       /* Only exists for backward compatibility.  See below:  */
-       
+        /* Link should point to a field of a heap allocated     */
+        /* object obj.  *link will be cleared when obj is       */
+        /* found to be inaccessible.  This happens BEFORE any   */
+        /* finalization code is invoked, and BEFORE any         */
+        /* decisions about finalization order are made.         */
+        /* This is useful in telling the finalizer that         */
+        /* some pointers are not essential for proper           */
+        /* finalization.  This may avoid finalization cycles.   */
+        /* Note that obj may be resurrected by another          */
+        /* finalizer, and thus the clearing of *link may        */
+        /* be visible to non-finalization code.                 */
+        /* There's an argument that an arbitrary action should  */
+        /* be allowed here, instead of just clearing a pointer. */
+        /* But this causes problems if that action alters, or   */
+        /* examines connectivity.  Returns GC_DUPLICATE if link */
+        /* was already registered, GC_SUCCESS if registration   */
+        /* succeeded, GC_NO_MEMORY if it failed for lack of     */
+        /* memory, and GC_oom_fn did not handle the problem.    */
+        /* Only exists for backward compatibility.  See below:  */
+
 GC_API int GC_CALL GC_general_register_disappearing_link(void ** /* link */,
-                                                       void * /* obj */);
-       /* A slight generalization of the above. *link is       */
-       /* cleared when obj first becomes inaccessible.  This   */
-       /* can be used to implement weak pointers easily and    */
-       /* safely. Typically link will point to a location      */
-       /* holding a disguised pointer to obj.  (A pointer      */
-       /* inside an "atomic" object is effectively disguised.) */
-       /* In this way, weak pointers are broken before any     */
-       /* object reachable from them gets finalized.           */
-       /* Each link may be registered only with one obj value, */
-       /* i.e. all objects but the last one (link registered   */
-       /* with) are ignored.  This was added after a long      */
-       /* email discussion with John Ellis.                    */
-       /* link must be non-NULL (and be properly aligned).     */
-       /* obj must be a pointer to the first word of an object */
-       /* allocated by GC_malloc or friends.  It is unsafe to  */
-       /* explicitly deallocate the object containing link.    */
-       /* Explicit deallocation of obj may or may not cause    */
-       /* link to eventually be cleared.                       */
-       /* This function can be used to implement certain types */
-       /* of weak pointers.  Note, however, this generally     */
-       /* requires that the allocation lock is held (see       */
-       /* GC_call_with_alloc_lock() below) when the disguised  */
-       /* pointer is accessed.  Otherwise a strong pointer     */
-       /* could be recreated between the time the collector    */
-       /* decides to reclaim the object and the link is        */
-       /* cleared.  Returns GC_SUCCESS if registration         */
-       /* succeeded (a new link is registered), GC_DUPLICATE   */
-       /* if link was already registered (with some object),   */
-       /* GC_NO_MEMORY if registration failed for lack of      */
-       /* memory (and GC_oom_fn did not handle the problem).   */
+                                                        void * /* obj */);
+        /* A slight generalization of the above. *link is       */
+        /* cleared when obj first becomes inaccessible.  This   */
+        /* can be used to implement weak pointers easily and    */
+        /* safely. Typically link will point to a location      */
+        /* holding a disguised pointer to obj.  (A pointer      */
+        /* inside an "atomic" object is effectively disguised.) */
+        /* In this way, weak pointers are broken before any     */
+        /* object reachable from them gets finalized.           */
+        /* Each link may be registered only with one obj value, */
+        /* i.e. all objects but the last one (link registered   */
+        /* with) are ignored.  This was added after a long      */
+        /* email discussion with John Ellis.                    */
+        /* link must be non-NULL (and be properly aligned).     */
+        /* obj must be a pointer to the first word of an object */
+        /* allocated by GC_malloc or friends.  It is unsafe to  */
+        /* explicitly deallocate the object containing link.    */
+        /* Explicit deallocation of obj may or may not cause    */
+        /* link to eventually be cleared.                       */
+        /* This function can be used to implement certain types */
+        /* of weak pointers.  Note, however, this generally     */
+        /* requires that the allocation lock is held (see       */
+        /* GC_call_with_alloc_lock() below) when the disguised  */
+        /* pointer is accessed.  Otherwise a strong pointer     */
+        /* could be recreated between the time the collector    */
+        /* decides to reclaim the object and the link is        */
+        /* cleared.  Returns GC_SUCCESS if registration         */
+        /* succeeded (a new link is registered), GC_DUPLICATE   */
+        /* if link was already registered (with some object),   */
+        /* GC_NO_MEMORY if registration failed for lack of      */
+        /* memory (and GC_oom_fn did not handle the problem).   */
 
 GC_API int GC_CALL GC_unregister_disappearing_link(void ** /* link */);
-       /* Undoes a registration by either of the above two     */
-       /* routines.  Returns 0 if link was not actually        */
-       /* registered (otherwise returns 1).                    */
+        /* Undoes a registration by either of the above two     */
+        /* routines.  Returns 0 if link was not actually        */
+        /* registered (otherwise returns 1).                    */
 
-/* Returns !=0 if GC_invoke_finalizers has something to do.    */
+/* Returns !=0 if GC_invoke_finalizers has something to do.     */
 GC_API int GC_CALL GC_should_invoke_finalizers(void);
 
 GC_API int GC_CALL GC_invoke_finalizers(void);
-       /* Run finalizers for all objects that are ready to     */
-       /* be finalized.  Return the number of finalizers       */
-       /* that were run.  Normally this is also called         */
-       /* implicitly during some allocations.  If              */
-       /* GC_finalize_on_demand is nonzero, it must be called  */
-       /* explicitly.                                          */
-
-/* Explicitly tell the collector that an object is reachable   */
-/* at a particular program point.  This prevents the argument  */
-/* pointer from being optimized away, even it is otherwise no  */
-/* longer needed.  It should have no visible effect in the     */
-/* absence of finalizers or disappearing links.  But it may be */
-/* needed to prevent finalizers from running while the         */
-/* associated external resource is still in use.               */
-/* The function is sometimes called keep_alive in other                */
-/* settings.                                                   */
+        /* Run finalizers for all objects that are ready to     */
+        /* be finalized.  Return the number of finalizers       */
+        /* that were run.  Normally this is also called         */
+        /* implicitly during some allocations.  If              */
+        /* GC_finalize_on_demand is nonzero, it must be called  */
+        /* explicitly.                                          */
+
+/* Explicitly tell the collector that an object is reachable    */
+/* at a particular program point.  This prevents the argument   */
+/* pointer from being optimized away, even it is otherwise no   */
+/* longer needed.  It should have no visible effect in the      */
+/* absence of finalizers or disappearing links.  But it may be  */
+/* needed to prevent finalizers from running while the          */
+/* associated external resource is still in use.                */
+/* The function is sometimes called keep_alive in other         */
+/* settings.                                                    */
 # if defined(__GNUC__) && !defined(__INTEL_COMPILER)
 #   define GC_reachable_here(ptr) \
     __asm__ volatile(" " : : "X"(ptr) : "memory");
@@ -947,235 +940,236 @@ GC_API int GC_CALL GC_invoke_finalizers(void);
 #   define GC_reachable_here(ptr) GC_noop1((GC_word)(ptr));
 #endif
 
-/* GC_set_warn_proc can be used to redirect or filter warning messages.        */
-/* p may not be a NULL pointer.  Both the setter and the getter acquire        */
-/* the GC lock (to avoid data races).                                  */
-typedef void (GC_CALLBACK * GC_warn_proc)(char * /* msg */, GC_word /* arg */);
+/* GC_set_warn_proc can be used to redirect or filter warning messages. */
+/* p may not be a NULL pointer.  Both the setter and the getter acquire */
+/* the GC lock (to avoid data races).                                   */
+typedef void (GC_CALLBACK * GC_warn_proc)(char * /* msg */,
+                                          GC_word /* arg */);
 GC_API void GC_CALL GC_set_warn_proc(GC_warn_proc /* p */);
-/* GC_get_warn_proc returns the current warn_proc.                     */
+/* GC_get_warn_proc returns the current warn_proc.                      */
 GC_API GC_warn_proc GC_CALL GC_get_warn_proc(void);
 
-    /* GC_ignore_warn_proc may be used as an argument for    */
-    /* GC_set_warn_proc() to suppress all warnings (unless   */
-    /* statistics printing is turned on).                   */
+    /* GC_ignore_warn_proc may be used as an argument for       */
+    /* GC_set_warn_proc() to suppress all warnings (unless      */
+    /* statistics printing is turned on).                       */
 GC_API void GC_CALLBACK GC_ignore_warn_proc(char *, GC_word);
 
-/* The following is intended to be used by a higher level      */
-/* (e.g. Java-like) finalization facility.  It is expected     */
-/* that finalization code will arrange for hidden pointers to  */
-/* disappear.  Otherwise objects can be accessed after they    */
-/* have been collected.                                                */
-/* Note that putting pointers in atomic objects or in          */
-/* nonpointer slots of "typed" objects is equivalent to        */
-/* disguising them in this way, and may have other advantages. */
+/* The following is intended to be used by a higher level       */
+/* (e.g. Java-like) finalization facility.  It is expected      */
+/* that finalization code will arrange for hidden pointers to   */
+/* disappear.  Otherwise objects can be accessed after they     */
+/* have been collected.                                         */
+/* Note that putting pointers in atomic objects or in           */
+/* nonpointer slots of "typed" objects is equivalent to         */
+/* disguising them in this way, and may have other advantages.  */
 # if defined(I_HIDE_POINTERS) || defined(GC_I_HIDE_POINTERS)
     typedef GC_word GC_hidden_pointer;
 #   define HIDE_POINTER(p) (~(GC_hidden_pointer)(p))
 #   define REVEAL_POINTER(p) ((void *)(HIDE_POINTER(p)))
-    /* Converting a hidden pointer to a real pointer requires verifying        */
-    /* that the object still exists.  This involves acquiring the      */
-    /* allocator lock to avoid a race with the collector.              */
+    /* Converting a hidden pointer to a real pointer requires verifying */
+    /* that the object still exists.  This involves acquiring the       */
+    /* allocator lock to avoid a race with the collector.               */
 # endif /* I_HIDE_POINTERS */
 
 typedef void * (GC_CALLBACK * GC_fn_type)(void * /* client_data */);
 GC_API void * GC_CALL GC_call_with_alloc_lock(GC_fn_type /* fn */,
-                                               void * /* client_data */);
-
-/* These routines are intended to explicitly notify the collector      */
-/* of new threads.  Often this is unnecessary because thread creation  */
-/* is implicitly intercepted by the collector, using header-file       */
-/* defines, or linker-based interception.  In the long run the intent  */
-/* is to always make redundant registration safe.  In the short run,   */
-/* this is being implemented a platform at a time.                     */
-/* The interface is complicated by the fact that we probably will not  */
-/* ever be able to automatically determine the stack base for thread   */
-/* stacks on all platforms.                                            */
-
-/* Structure representing the base of a thread stack.  On most         */
-/* platforms this contains just a single address.                      */
+                                                void * /* client_data */);
+
+/* These routines are intended to explicitly notify the collector       */
+/* of new threads.  Often this is unnecessary because thread creation   */
+/* is implicitly intercepted by the collector, using header-file        */
+/* defines, or linker-based interception.  In the long run the intent   */
+/* is to always make redundant registration safe.  In the short run,    */
+/* this is being implemented a platform at a time.                      */
+/* The interface is complicated by the fact that we probably will not   */
+/* ever be able to automatically determine the stack base for thread    */
+/* stacks on all platforms.                                             */
+
+/* Structure representing the base of a thread stack.  On most          */
+/* platforms this contains just a single address.                       */
 struct GC_stack_base {
-       void * mem_base;        /* Base of memory stack.        */
-#      if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
-         void * reg_base;      /* Base of separate register stack.     */
-#      endif
+        void * mem_base;        /* Base of memory stack.        */
+#       if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+          void * reg_base;      /* Base of separate register stack.     */
+#       endif
 };
 
 typedef void * (GC_CALLBACK * GC_stack_base_func)(
-               struct GC_stack_base * /* sb */, void * /* arg */);
+                struct GC_stack_base * /* sb */, void * /* arg */);
 
-/* Call a function with a stack base structure corresponding to                */
-/* somewhere in the GC_call_with_stack_base frame.  This often can     */
-/* be used to provide a sufficiently accurate stack base.  And we      */
-/* implement it everywhere.                                            */
+/* Call a function with a stack base structure corresponding to         */
+/* somewhere in the GC_call_with_stack_base frame.  This often can      */
+/* be used to provide a sufficiently accurate stack base.  And we       */
+/* implement it everywhere.                                             */
 GC_API void * GC_CALL GC_call_with_stack_base(GC_stack_base_func /* fn */,
-                                               void * /* arg */);
-
-/* Explicitly enable GC_register_my_thread() invocation.               */
-/* Done implicitly if a GC thread-creation function is called (or      */
-/* DllMain-based thread registration is enabled).  Otherwise, it must  */
-/* be called from the main (or any previously registered) thread       */
-/* between the collector initialization and the first explicit         */
-/* registering of a thread (it should be called as late as possible).  */
+                                                void * /* arg */);
+
+/* Explicitly enable GC_register_my_thread() invocation.                */
+/* Done implicitly if a GC thread-creation function is called (or       */
+/* DllMain-based thread registration is enabled).  Otherwise, it must   */
+/* be called from the main (or any previously registered) thread        */
+/* between the collector initialization and the first explicit          */
+/* registering of a thread (it should be called as late as possible).   */
 GC_API void GC_CALL GC_allow_register_threads(void);
 
-/* Register the current thread, with the indicated stack base, as      */
-/* a new thread whose stack(s) should be traced by the GC.  If it      */
-/* is not implicitly called by the GC, this must be called before a    */
-/* thread can allocate garbage collected memory, or assign pointers    */
-/* to the garbage collected heap.  Once registered, a thread will be   */
-/* stopped during garbage collections.                                 */
-/* This call must be previously enabled (see above).                   */
-/* This should never be called from the main thread, where it is       */
-/* always done implicitly.  This is normally done implicitly if GC_    */
-/* functions are called to create the thread, e.g. by defining         */
-/* GC_THREADS and including gc.h (which redefines some system          */
-/* functions) before calling the system thread creation function.      */
-/* It is also always done implicitly under win32 with DllMain-based    */
-/* thread registration enabled.  Except in this latter case, explicit  */
-/* calls are normally required for threads created by third-party      */
-/* libraries.                                                          */
+/* Register the current thread, with the indicated stack base, as       */
+/* a new thread whose stack(s) should be traced by the GC.  If it       */
+/* is not implicitly called by the GC, this must be called before a     */
+/* thread can allocate garbage collected memory, or assign pointers     */
+/* to the garbage collected heap.  Once registered, a thread will be    */
+/* stopped during garbage collections.                                  */
+/* This call must be previously enabled (see above).                    */
+/* This should never be called from the main thread, where it is        */
+/* always done implicitly.  This is normally done implicitly if GC_     */
+/* functions are called to create the thread, e.g. by defining          */
+/* GC_THREADS and including gc.h (which redefines some system           */
+/* functions) before calling the system thread creation function.       */
+/* It is also always done implicitly under win32 with DllMain-based     */
+/* thread registration enabled.  Except in this latter case, explicit   */
+/* calls are normally required for threads created by third-party       */
+/* libraries.                                                           */
 #define GC_SUCCESS 0
-#define GC_DUPLICATE 1 /* Was already registered.      */
-#define GC_NO_THREADS 2        /* No thread support in GC.     */
-    /* GC_NO_THREADS is not returned by any GC func anymore. */
-#define GC_UNIMPLEMENTED 3     /* Not yet implemented on this platform. */
+#define GC_DUPLICATE 1         /* Was already registered.               */
+#define GC_NO_THREADS 2        /* No thread support in GC.              */
+    /* GC_NO_THREADS is not returned by any GC func anymore.            */
+#define GC_UNIMPLEMENTED 3     /* Not yet implemented on this platform. */
 GC_API int GC_CALL GC_register_my_thread(const struct GC_stack_base *);
 
-/* Unregister the current thread.  Only an explicity registered thread */
-/* (i.e. for which GC_register_my_thread() returns GC_SUCCESS) is      */
-/* allowed (and required) to call this function.  The thread may no    */
-/* longer allocate garbage collected memory or manipulate pointers to  */
-/* the garbage collected heap after making this call.                  */
-/* Specifically, if it wants to return or otherwise communicate a      */
-/* pointer to the garbage-collected heap to another thread, it must    */
-/* do this before calling GC_unregister_my_thread, most probably       */
-/* by saving it in a global data structure.  Must not be called inside */
-/* a GC callback function (except for GC_call_with_stack_base() one).  */
+/* Unregister the current thread.  Only an explicity registered thread  */
+/* (i.e. for which GC_register_my_thread() returns GC_SUCCESS) is       */
+/* allowed (and required) to call this function.  The thread may no     */
+/* longer allocate garbage collected memory or manipulate pointers to   */
+/* the garbage collected heap after making this call.                   */
+/* Specifically, if it wants to return or otherwise communicate a       */
+/* pointer to the garbage-collected heap to another thread, it must     */
+/* do this before calling GC_unregister_my_thread, most probably        */
+/* by saving it in a global data structure.  Must not be called inside  */
+/* a GC callback function (except for GC_call_with_stack_base() one).   */
 GC_API int GC_CALL GC_unregister_my_thread(void);
 
-/* Wrapper for functions that are likely to block (or, at least, do not        */
-/* allocate garbage collected memory and/or manipulate pointers to the */
-/* garbage collected heap) for an appreciable length of time.  While fn        */
-/* is running, the collector is said to be in the "inactive" state for */
-/* the current thread (this means that the thread is not suspended and */
-/* the thread's stack frames "belonging" to the functions in the       */
-/* "inactive" state are not scanned during garbage collections).  It is        */
-/* allowed for fn to call GC_call_with_gc_active() (even recursively), */
-/* thus temporarily toggling the collector's state back to "active".   */
+/* Wrapper for functions that are likely to block (or, at least, do not */
+/* allocate garbage collected memory and/or manipulate pointers to the  */
+/* garbage collected heap) for an appreciable length of time.  While fn */
+/* is running, the collector is said to be in the "inactive" state for  */
+/* the current thread (this means that the thread is not suspended and  */
+/* the thread's stack frames "belonging" to the functions in the        */
+/* "inactive" state are not scanned during garbage collections).  It is */
+/* allowed for fn to call GC_call_with_gc_active() (even recursively),  */
+/* thus temporarily toggling the collector's state back to "active".    */
 GC_API void * GC_CALL GC_do_blocking(GC_fn_type /* fn */,
-                                    void * /* client_data */);
-
-/* Call a function switching to the "active" state of the collector for        */
-/* the current thread (i.e. the user function is allowed to call any   */
-/* GC function and/or manipulate pointers to the garbage collected     */
-/* heap).  GC_call_with_gc_active() has the functionality opposite to  */
-/* GC_do_blocking() one.  It is assumed that the collector is already  */
-/* initialized and the current thread is registered.  fn may toggle    */
-/* the collector thread's state temporarily to "inactive" one by using */
-/* GC_do_blocking.  GC_call_with_gc_active() often can be used to      */
-/* provide a sufficiently accurate stack base.                         */
+                                     void * /* client_data */);
+
+/* Call a function switching to the "active" state of the collector for */
+/* the current thread (i.e. the user function is allowed to call any    */
+/* GC function and/or manipulate pointers to the garbage collected      */
+/* heap).  GC_call_with_gc_active() has the functionality opposite to   */
+/* GC_do_blocking() one.  It is assumed that the collector is already   */
+/* initialized and the current thread is registered.  fn may toggle     */
+/* the collector thread's state temporarily to "inactive" one by using  */
+/* GC_do_blocking.  GC_call_with_gc_active() often can be used to       */
+/* provide a sufficiently accurate stack base.                          */
 GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type /* fn */,
-                                       void * /* client_data */);
-
-/* Attempt to fill in the GC_stack_base structure with the stack base  */
-/* for this thread.  This appears to be required to implement anything */
-/* like the JNI AttachCurrentThread in an environment in which new     */
-/* threads are not automatically registered with the collector.                */
-/* It is also unfortunately hard to implement well on many platforms.  */
-/* Returns GC_SUCCESS or GC_UNIMPLEMENTED.                             */
+                                        void * /* client_data */);
+
+/* Attempt to fill in the GC_stack_base structure with the stack base   */
+/* for this thread.  This appears to be required to implement anything  */
+/* like the JNI AttachCurrentThread in an environment in which new      */
+/* threads are not automatically registered with the collector.         */
+/* It is also unfortunately hard to implement well on many platforms.   */
+/* Returns GC_SUCCESS or GC_UNIMPLEMENTED.                              */
 GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *);
 
-/* The following routines are primarily intended for use with a        */
-/* preprocessor which inserts calls to check C pointer arithmetic.     */
-/* They indicate failure by invoking the corresponding _print_proc.    */
+/* The following routines are primarily intended for use with a         */
+/* preprocessor which inserts calls to check C pointer arithmetic.      */
+/* They indicate failure by invoking the corresponding _print_proc.     */
 
-/* Check that p and q point to the same object.                */
-/* Fail conspicuously if they don't.                           */
-/* Returns the first argument.                                 */
-/* Succeeds if neither p nor q points to the heap.             */
-/* May succeed if both p and q point to between heap objects.  */
+/* Check that p and q point to the same object.                 */
+/* Fail conspicuously if they don't.                            */
+/* Returns the first argument.                                  */
+/* Succeeds if neither p nor q points to the heap.              */
+/* May succeed if both p and q point to between heap objects.   */
 GC_API void * GC_CALL GC_same_obj(void * /* p */, void * /* q */);
 
-/* Checked pointer pre- and post- increment operations.  Note that     */
-/* the second argument is in units of bytes, not multiples of the      */
-/* object size.  This should either be invoked from a macro, or the    */
-/* call should be automatically generated.                             */
+/* Checked pointer pre- and post- increment operations.  Note that      */
+/* the second argument is in units of bytes, not multiples of the       */
+/* object size.  This should either be invoked from a macro, or the     */
+/* call should be automatically generated.                              */
 GC_API void * GC_CALL GC_pre_incr(void **, ptrdiff_t /* how_much */);
 GC_API void * GC_CALL GC_post_incr(void **, ptrdiff_t /* how_much */);
 
-/* Check that p is visible                                             */
-/* to the collector as a possibly pointer containing location.         */
-/* If it isn't fail conspicuously.                                     */
-/* Returns the argument in all cases.  May erroneously succeed         */
-/* in hard cases.  (This is intended for debugging use with            */
-/* untyped allocations.  The idea is that it should be possible, though        */
-/* slow, to add such a call to all indirect pointer stores.)           */
-/* Currently useless for multithreaded worlds.                         */
+/* Check that p is visible                                              */
+/* to the collector as a possibly pointer containing location.          */
+/* If it isn't fail conspicuously.                                      */
+/* Returns the argument in all cases.  May erroneously succeed          */
+/* in hard cases.  (This is intended for debugging use with             */
+/* untyped allocations.  The idea is that it should be possible, though */
+/* slow, to add such a call to all indirect pointer stores.)            */
+/* Currently useless for multithreaded worlds.                          */
 GC_API void * GC_CALL GC_is_visible(void * /* p */);
 
-/* Check that if p is a pointer to a heap page, then it points to      */
-/* a valid displacement within a heap object.                          */
-/* Fail conspicuously if this property does not hold.                  */
-/* Uninteresting with GC_all_interior_pointers.                                */
-/* Always returns its argument.                                                */
+/* Check that if p is a pointer to a heap page, then it points to       */
+/* a valid displacement within a heap object.                           */
+/* Fail conspicuously if this property does not hold.                   */
+/* Uninteresting with GC_all_interior_pointers.                         */
+/* Always returns its argument.                                         */
 GC_API void * GC_CALL GC_is_valid_displacement(void * /* p */);
 
-/* Explicitly dump the GC state.  This is most often called from the   */
-/* debugger, or by setting the GC_DUMP_REGULARLY environment variable, */
-/* but it may be useful to call it from client code during debugging.  */
-/* Defined only if the library has been compiled without NO_DEBUGGING. */
+/* Explicitly dump the GC state.  This is most often called from the    */
+/* debugger, or by setting the GC_DUMP_REGULARLY environment variable,  */
+/* but it may be useful to call it from client code during debugging.   */
+/* Defined only if the library has been compiled without NO_DEBUGGING.  */
 GC_API void GC_CALL GC_dump(void);
 
-/* Safer, but slow, pointer addition.  Probably useful mainly with     */
-/* a preprocessor.  Useful only for heap pointers.                     */
-/* Only the macros without trailing digits are meant to be used                */
-/* by clients.  These are designed to model the available C pointer    */
-/* arithmetic expressions.                                             */
-/* Even then, these are probably more useful as                        */
-/* documentation than as part of the API.                              */
-/* Note that GC_PTR_ADD evaluates the first argument more than once.   */
+/* Safer, but slow, pointer addition.  Probably useful mainly with      */
+/* a preprocessor.  Useful only for heap pointers.                      */
+/* Only the macros without trailing digits are meant to be used         */
+/* by clients.  These are designed to model the available C pointer     */
+/* arithmetic expressions.                                              */
+/* Even then, these are probably more useful as                         */
+/* documentation than as part of the API.                               */
+/* Note that GC_PTR_ADD evaluates the first argument more than once.    */
 #if defined(GC_DEBUG) && defined(__GNUC__)
 #   define GC_PTR_ADD3(x, n, type_of_result) \
-       ((type_of_result)GC_same_obj((x)+(n), (x)))
+        ((type_of_result)GC_same_obj((x)+(n), (x)))
 #   define GC_PRE_INCR3(x, n, type_of_result) \
-       ((type_of_result)GC_pre_incr((void **)(&(x)), (n)*sizeof(*x)))
+        ((type_of_result)GC_pre_incr((void **)(&(x)), (n)*sizeof(*x)))
 #   define GC_POST_INCR3(x, n, type_of_result) \
-       ((type_of_result)GC_post_incr((void **)(&(x)), (n)*sizeof(*x)))
+        ((type_of_result)GC_post_incr((void **)(&(x)), (n)*sizeof(*x)))
 #   define GC_PTR_ADD(x, n) \
-           GC_PTR_ADD3(x, n, typeof(x))
+            GC_PTR_ADD3(x, n, typeof(x))
 #   define GC_PRE_INCR(x, n) \
-           GC_PRE_INCR3(x, n, typeof(x))
+            GC_PRE_INCR3(x, n, typeof(x))
 #   define GC_POST_INCR(x) \
-           GC_POST_INCR3(x, 1, typeof(x))
+            GC_POST_INCR3(x, 1, typeof(x))
 #   define GC_POST_DECR(x) \
-           GC_POST_INCR3(x, -1, typeof(x))
-#else  /* !GC_DEBUG || !__GNUC__ */
-       /* We can't do this right without typeof, which ANSI    */
-       /* decided was not sufficiently useful.  Without it     */
-       /* we resort to the non-debug version.                  */
-       /* FIXME: This should eventually support C++0x decltype */
+            GC_POST_INCR3(x, -1, typeof(x))
+#else   /* !GC_DEBUG || !__GNUC__ */
+        /* We can't do this right without typeof, which ANSI    */
+        /* decided was not sufficiently useful.  Without it     */
+        /* we resort to the non-debug version.                  */
+        /* FIXME: This should eventually support C++0x decltype */
 #   define GC_PTR_ADD(x, n) ((x)+(n))
 #   define GC_PRE_INCR(x, n) ((x) += (n))
 #   define GC_POST_INCR(x) ((x)++)
 #   define GC_POST_DECR(x) ((x)--)
 #endif
 
-/* Safer assignment of a pointer to a non-stack location.      */
+/* Safer assignment of a pointer to a non-stack location.       */
 #ifdef GC_DEBUG
 #   define GC_PTR_STORE(p, q) \
-       (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q))
+        (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q))
 #else /* !GC_DEBUG */
 #   define GC_PTR_STORE(p, q) (*(p) = (q))
 #endif
 
 /* Functions called to report pointer checking errors */
 GC_API void (GC_CALLBACK * GC_same_obj_print_proc)(void * /* p */,
-                                                  void * /* q */);
+                                                   void * /* q */);
 GC_API void (GC_CALLBACK * GC_is_valid_displacement_print_proc)(void *);
 GC_API void (GC_CALLBACK * GC_is_visible_print_proc)(void *);
 
-/* For pthread support, we generally need to intercept a number of     */
-/* thread library calls.  We do that here by macro defining them.      */
+/* For pthread support, we generally need to intercept a number of      */
+/* thread library calls.  We do that here by macro defining them.       */
 
 #if !defined(GC_USE_LD_WRAP) && !defined(GC_NO_THREAD_REDIRECTS) \
     && defined(GC_PTHREADS)
@@ -1184,38 +1178,38 @@ GC_API void (GC_CALLBACK * GC_is_visible_print_proc)(void *);
 
 # if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
      defined(GC_PTHREADS) || defined(GC_WIN32_THREADS)
-       /* Any flavor of threads.       */
-/* This returns a list of objects, linked through their first          */
-/* word.  Its use can greatly reduce lock contention problems, since   */
-/* the allocation lock can be acquired and released many fewer times.  */
+        /* Any flavor of threads.       */
+/* This returns a list of objects, linked through their first           */
+/* word.  Its use can greatly reduce lock contention problems, since    */
+/* the allocation lock can be acquired and released many fewer times.   */
 GC_API void * GC_CALL GC_malloc_many(size_t /* lb */);
-#define GC_NEXT(p) (*(void * *)(p))    /* Retrieve the next element    */
-                                       /* in returned list.            */
+#define GC_NEXT(p) (*(void * *)(p))     /* Retrieve the next element    */
+                                        /* in returned list.            */
 
 #endif /* THREADS */
 
-/* A filter function to control the scanning of dynamic libraries.     */
-/* If implemented, called by GC before registering a dynamic library   */
-/* (discovered by GC) section as a static data root (called only as    */
-/* a last reason not to register).  The filename of the library, the   */
-/* address and the length of the memory region (section) are passed.   */
-/* This routine should return nonzero if that region should be scanned.        */
-/* Always called with the allocation lock held.  Depending on the      */
-/* platform, might be called with the "world" stopped.                 */
+/* A filter function to control the scanning of dynamic libraries.      */
+/* If implemented, called by GC before registering a dynamic library    */
+/* (discovered by GC) section as a static data root (called only as     */
+/* a last reason not to register).  The filename of the library, the    */
+/* address and the length of the memory region (section) are passed.    */
+/* This routine should return nonzero if that region should be scanned. */
+/* Always called with the allocation lock held.  Depending on the       */
+/* platform, might be called with the "world" stopped.                  */
 typedef int (GC_CALLBACK * GC_has_static_roots_func)(
-                                       const char * /* dlpi_name */,
-                                       void * /* section_start */,
-                                       size_t /* section_size */);
-
-/* Register a new callback (a user-supplied filter) to control the     */
-/* scanning of dynamic libraries.  Replaces any previously registered  */
-/* callback.  May be 0 (means no filtering).  May be unused on some    */
-/* platforms (if the filtering is unimplemented or inappropriate).     */
+                                        const char * /* dlpi_name */,
+                                        void * /* section_start */,
+                                        size_t /* section_size */);
+
+/* Register a new callback (a user-supplied filter) to control the      */
+/* scanning of dynamic libraries.  Replaces any previously registered   */
+/* callback.  May be 0 (means no filtering).  May be unused on some     */
+/* platforms (if the filtering is unimplemented or inappropriate).      */
 GC_API void GC_CALL GC_register_has_static_roots_callback(
-                                       GC_has_static_roots_func);
+                                        GC_has_static_roots_func);
 
 #if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) \
-       && !defined(__CYGWIN__) && !defined(GC_PTHREADS)
+        && !defined(__CYGWIN__) && !defined(GC_PTHREADS)
 
 #ifndef GC_NO_THREAD_DECLS
 
@@ -1224,7 +1218,7 @@ GC_API void GC_CALL GC_register_has_static_roots_callback(
 #endif
 
 # if !defined(_WIN32_WCE) && !defined(__CEGCC__)
-#   include <process.h>        /* For _beginthreadex, _endthreadex */
+#   include <process.h> /* For _beginthreadex, _endthreadex */
 # endif
 
 # include <windows.h>
@@ -1232,26 +1226,23 @@ GC_API void GC_CALL GC_register_has_static_roots_callback(
 #ifdef __cplusplus
     extern "C" {
 #endif
-  /*
-   * All threads must be created using GC_CreateThread or GC_beginthreadex,
-   * or must explicitly call GC_register_my_thread
-   * (and call GC_unregister_my_thread before thread termination),
-   * so that they will be recorded in the thread table.
-   * For backwards compatibility, it is possible to build the GC
-   * with GC_DLL defined, and to call GC_use_DllMain().
-   * This implicitly registers all created threads, but appears to be
-   * less robust.
-   *
-   * Currently the collector expects all threads to fall through and
-   * terminate normally, or call GC_endthreadex() or GC_ExitThread,
-   * so that the thread is properly unregistered.
-   */
+
+  /* All threads must be created using GC_CreateThread or               */
+  /* GC_beginthreadex, or must explicitly call GC_register_my_thread    */
+  /* (and call GC_unregister_my_thread before thread termination), so   */
+  /* that they will be recorded in the thread table.  For backward      */
+  /* compatibility, it is possible to build the GC with GC_DLL defined, */
+  /* and to call GC_use_DllMain().  This implicitly registers all       */
+  /* created threads, but appears to be less robust.                    */
+  /* Currently the collector expects all threads to fall through and    */
+  /* terminate normally, or call GC_endthreadex() or GC_ExitThread,     */
+  /* so that the thread is properly unregistered.                       */
    GC_API HANDLE WINAPI GC_CreateThread(
-               LPSECURITY_ATTRIBUTES /* lpThreadAttributes */,
-               DWORD /* dwStackSize */,
-               LPTHREAD_START_ROUTINE /* lpStartAddress */,
-               LPVOID /* lpParameter */, DWORD /* dwCreationFlags */,
-               LPDWORD /* lpThreadId */);
+                LPSECURITY_ATTRIBUTES /* lpThreadAttributes */,
+                DWORD /* dwStackSize */,
+                LPTHREAD_START_ROUTINE /* lpStartAddress */,
+                LPVOID /* lpParameter */, DWORD /* dwCreationFlags */,
+                LPDWORD /* lpThreadId */);
 
    GC_API void WINAPI GC_ExitThread(DWORD /* dwExitCode */);
 
@@ -1265,10 +1256,10 @@ GC_API void GC_CALL GC_register_has_static_roots_callback(
 #  endif
 
    GC_API GC_uintptr_t GC_CALL GC_beginthreadex(
-                       void * /* security */, unsigned /* stack_size */,
-                       unsigned (__stdcall *)(void *),
-                       void * /* arglist */, unsigned /* initflag */,
-                       unsigned * /* thrdaddr */);
+                        void * /* security */, unsigned /* stack_size */,
+                        unsigned (__stdcall *)(void *),
+                        void * /* arglist */, unsigned /* initflag */,
+                        unsigned * /* thrdaddr */);
 
    GC_API void GC_CALL GC_endthreadex(unsigned /* retval */);
 
@@ -1311,15 +1302,13 @@ GC_API void GC_CALL GC_use_DllMain(void);
 
 #endif /* defined(GC_WIN32_THREADS)  && !cygwin */
 
- /*
-  * Fully portable code should call GC_INIT() from the main program
-  * before making any other GC_ calls.  On most platforms this is a
-  * no-op and the collector self-initializes.  But a number of platforms
-  * make that too hard.
-  * A GC_INIT call is required if the collector is built with THREAD_LOCAL_ALLOC
-  * defined and the initial allocation call is not to GC_malloc() or
-  * GC_malloc_atomic().
-  */
+ /* Fully portable code should call GC_INIT() from the main program     */
+ /* before making any other GC_ calls.  On most platforms this is a     */
+ /* no-op and the collector self-initializes.  But a number of          */
+ /* platforms make that too hard.                                       */
+ /* A GC_INIT call is required if the collector is built with           */
+ /* THREAD_LOCAL_ALLOC defined and the initial allocation call is not   */
+ /* to GC_malloc() or GC_malloc_atomic().                               */
 
     /*
      * Similarly gnu-win32 DLLs need explicit initialization from
@@ -1333,10 +1322,10 @@ GC_API void GC_CALL GC_use_DllMain(void);
 #     define GC_MAX(x,y) ((x) > (y) ? (x) : (y))
 #     define GC_MIN(x,y) ((x) < (y) ? (x) : (y))
 #     define GC_DATASTART ((void *) GC_MIN(_data_start__, _bss_start__))
-#     define GC_DATAEND         ((void *) GC_MAX(_data_end__, _bss_end__))
+#     define GC_DATAEND  ((void *) GC_MAX(_data_end__, _bss_end__))
 #     define GC_INIT_CONF_ROOTS GC_add_roots(GC_DATASTART, GC_DATAEND); \
-                                GC_gcollect() /* For blacklisting. */
-       /* Required at least if GC is in dll.  And doesn't hurt. */
+                                 GC_gcollect() /* For blacklisting. */
+        /* Required at least if GC is in dll.  And doesn't hurt. */
 #elif defined(_AIX)
       extern int _data[], _end[];
 #     define GC_DATASTART ((void *)((ulong)_data))
@@ -1363,7 +1352,7 @@ GC_API void GC_CALL GC_use_DllMain(void);
 #ifdef GC_FREE_SPACE_DIVISOR
   /* Set GC_free_space_divisor to the desired value at start-up */
 # define GC_INIT_CONF_FREE_SPACE_DIVISOR \
-               GC_set_free_space_divisor(GC_FREE_SPACE_DIVISOR)
+                GC_set_free_space_divisor(GC_FREE_SPACE_DIVISOR)
 #else
 # define GC_INIT_CONF_FREE_SPACE_DIVISOR /* empty */
 #endif
@@ -1383,12 +1372,12 @@ GC_API void GC_CALL GC_use_DllMain(void);
 #endif
 
 #ifdef GC_MAXIMUM_HEAP_SIZE
-  /* Limit the heap size to the desired value (useful for debugging).  */
-  /* The limit could be overridden either at the program start-up by   */
-  /* the similar environment variable or anytime later by the          */
-  /* corresponding API function call.                                  */
+  /* Limit the heap size to the desired value (useful for debugging).   */
+  /* The limit could be overridden either at the program start-up by    */
+  /* the similar environment variable or anytime later by the           */
+  /* corresponding API function call.                                   */
 # define GC_INIT_CONF_MAXIMUM_HEAP_SIZE \
-               GC_set_max_heap_size(GC_MAXIMUM_HEAP_SIZE)
+                GC_set_max_heap_size(GC_MAXIMUM_HEAP_SIZE)
 #else
 # define GC_INIT_CONF_MAXIMUM_HEAP_SIZE /* empty */
 #endif
@@ -1403,30 +1392,30 @@ GC_API void GC_CALL GC_use_DllMain(void);
 #ifdef GC_INITIAL_HEAP_SIZE
   /* Set heap size to the desired value at start-up */
 # define GC_INIT_CONF_INITIAL_HEAP_SIZE \
-               { size_t heap_size = GC_get_heap_size(); \
-                 if (heap_size < (GC_INITIAL_HEAP_SIZE)) \
+                { size_t heap_size = GC_get_heap_size(); \
+                  if (heap_size < (GC_INITIAL_HEAP_SIZE)) \
                     (void)GC_expand_hp((GC_INITIAL_HEAP_SIZE) - heap_size); }
 #else
 # define GC_INIT_CONF_INITIAL_HEAP_SIZE /* empty */
 #endif
 
 #define GC_INIT() { GC_INIT_CONF_DONT_EXPAND; /* pre-init */ \
-                   GC_INIT_CONF_MAX_RETRIES; \
-                   GC_INIT_CONF_FREE_SPACE_DIVISOR; \
-                   GC_INIT_CONF_FULL_FREQ; \
-                   GC_INIT_CONF_TIME_LIMIT; \
-                   GC_INIT_CONF_MAXIMUM_HEAP_SIZE; \
-                   GC_init(); /* real GC initialization */ \
-                   GC_INIT_CONF_ROOTS; /* post-init */ \
-                   GC_INIT_CONF_IGNORE_WARN; \
-                   GC_INIT_CONF_INITIAL_HEAP_SIZE; }
-
-  /* win32S may not free all resources on process exit.  */
-  /* This explicitly deallocates the heap.              */
+                    GC_INIT_CONF_MAX_RETRIES; \
+                    GC_INIT_CONF_FREE_SPACE_DIVISOR; \
+                    GC_INIT_CONF_FULL_FREQ; \
+                    GC_INIT_CONF_TIME_LIMIT; \
+                    GC_INIT_CONF_MAXIMUM_HEAP_SIZE; \
+                    GC_init(); /* real GC initialization */ \
+                    GC_INIT_CONF_ROOTS; /* post-init */ \
+                    GC_INIT_CONF_IGNORE_WARN; \
+                    GC_INIT_CONF_INITIAL_HEAP_SIZE; }
+
+  /* win32S may not free all resources on process exit.         */
+  /* This explicitly deallocates the heap.                      */
 GC_API void GC_CALL GC_win32_free_heap(void);
 
 #if ( defined(_AMIGA) && !defined(GC_AMIGA_MAKINGLIB) )
-  /* Allocation really goes through GC_amiga_allocwrapper_do */
+  /* Allocation really goes through GC_amiga_allocwrapper_do    */
 # include "gc_amiga_redirects.h"
 #endif
 
index 788ceae..03010c4 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -14,7 +14,7 @@
  * provided the above notices are retained, and a notice that the code was
  * modified is included with the above copyright notice.
  */
+
 
 # ifndef GC_PRIVATE_H
 # define GC_PRIVATE_H
@@ -68,9 +68,9 @@ typedef int GC_bool;
 # define TRUE 1
 # define FALSE 0
 
-typedef char * ptr_t;  /* A generic pointer to which we can add        */
-                       /* byte displacements and which can be used     */
-                       /* for address comparisons.                     */
+typedef char * ptr_t;   /* A generic pointer to which we can add        */
+                        /* byte displacements and which can be used     */
+                        /* for address comparisons.                     */
 
 # ifndef GCCONFIG_H
 #   include "gcconfig.h"
@@ -105,7 +105,7 @@ typedef char * ptr_t;       /* A generic pointer to which we can add        */
 #   define COOLER_THAN >
 #   define HOTTER_THAN <
 #   define MAKE_COOLER(x,y) if ((x)+(y) > (x)) {(x) += (y);} \
-                           else {(x) = (ptr_t)ONES;}
+                            else {(x) = (ptr_t)ONES;}
 #   define MAKE_HOTTER(x,y) (x) -= (y)
 # else
 #   define COOLER_THAN <
@@ -135,37 +135,37 @@ typedef char * ptr_t;     /* A generic pointer to which we can add        */
 /*********************************/
 
 /* #define STUBBORN_ALLOC */
-                   /* Enable stubborn allocation, and thus a limited   */
-                   /* form of incremental collection w/o dirty bits.   */
+                    /* Enable stubborn allocation, and thus a limited   */
+                    /* form of incremental collection w/o dirty bits.   */
 
 /* #define ALL_INTERIOR_POINTERS */
-                   /* Forces all pointers into the interior of an      */
-                   /* object to be considered valid.  Also causes the  */
-                   /* sizes of all objects to be inflated by at least  */
-                   /* one byte.  This should suffice to guarantee      */
-                   /* that in the presence of a compiler that does     */
-                   /* not perform garbage-collector-unsafe             */
-                   /* optimizations, all portable, strictly ANSI       */
-                   /* conforming C programs should be safely usable    */
-                   /* with malloc replaced by GC_malloc and free       */
-                   /* calls removed.  There are several disadvantages: */
-                   /* 1. There are probably no interesting, portable,  */
-                   /*    strictly ANSI conforming C programs.          */
-                   /* 2. This option makes it hard for the collector   */
-                   /*    to allocate space that is not ``pointed to''  */
-                   /*    by integers, etc.  Under SunOS 4.X with a     */
-                   /*    statically linked libc, we empirically        */
-                   /*    observed that it would be difficult to        */
-                   /*    allocate individual objects larger than 100K. */
-                   /*    Even if only smaller objects are allocated,   */
-                   /*    more swap space is likely to be needed.       */
-                   /*    Fortunately, much of this will never be       */
-                   /*    touched.                                      */
-                   /* If you can easily avoid using this option, do.   */
-                   /* If not, try to keep individual objects small.    */
-                   /* This is now really controlled at startup,        */
-                   /* through GC_all_interior_pointers.                */
-                   
+                    /* Forces all pointers into the interior of an      */
+                    /* object to be considered valid.  Also causes the  */
+                    /* sizes of all objects to be inflated by at least  */
+                    /* one byte.  This should suffice to guarantee      */
+                    /* that in the presence of a compiler that does     */
+                    /* not perform garbage-collector-unsafe             */
+                    /* optimizations, all portable, strictly ANSI       */
+                    /* conforming C programs should be safely usable    */
+                    /* with malloc replaced by GC_malloc and free       */
+                    /* calls removed.  There are several disadvantages: */
+                    /* 1. There are probably no interesting, portable,  */
+                    /*    strictly ANSI conforming C programs.          */
+                    /* 2. This option makes it hard for the collector   */
+                    /*    to allocate space that is not ``pointed to''  */
+                    /*    by integers, etc.  Under SunOS 4.X with a     */
+                    /*    statically linked libc, we empirically        */
+                    /*    observed that it would be difficult to        */
+                    /*    allocate individual objects larger than 100K. */
+                    /*    Even if only smaller objects are allocated,   */
+                    /*    more swap space is likely to be needed.       */
+                    /*    Fortunately, much of this will never be       */
+                    /*    touched.                                      */
+                    /* If you can easily avoid using this option, do.   */
+                    /* If not, try to keep individual objects small.    */
+                    /* This is now really controlled at startup,        */
+                    /* through GC_all_interior_pointers.                */
+
 
 #define GC_INVOKE_FINALIZERS() GC_notify_or_invoke_finalizers()
 
@@ -179,8 +179,8 @@ typedef char * ptr_t;       /* A generic pointer to which we can add        */
 
 
 # ifndef LARGE_CONFIG
-#   define MINHINCR 16  /* Minimum heap increment, in blocks of HBLKSIZE  */
-                        /* Must be multiple of largest page size.         */
+#   define MINHINCR 16   /* Minimum heap increment, in blocks of HBLKSIZE  */
+                         /* Must be multiple of largest page size.         */
 #   define MAXHINCR 2048 /* Maximum heap increment, in blocks              */
 # else
 #   define MINHINCR 64
@@ -188,42 +188,42 @@ typedef char * ptr_t;     /* A generic pointer to which we can add        */
 # endif
 
 # define BL_LIMIT GC_black_list_spacing
-                          /* If we need a block of N bytes, and we have */
-                          /* a block of N + BL_LIMIT bytes available,   */
-                          /* and N > BL_LIMIT,                          */
-                          /* but all possible positions in it are       */
-                          /* blacklisted, we just use it anyway (and    */
-                          /* print a warning, if warnings are enabled). */
-                          /* This risks subsequently leaking the block  */
-                          /* due to a false reference.  But not using   */
-                          /* the block risks unreasonable immediate     */
-                          /* heap growth.                               */
+                           /* If we need a block of N bytes, and we have */
+                           /* a block of N + BL_LIMIT bytes available,   */
+                           /* and N > BL_LIMIT,                          */
+                           /* but all possible positions in it are       */
+                           /* blacklisted, we just use it anyway (and    */
+                           /* print a warning, if warnings are enabled). */
+                           /* This risks subsequently leaking the block  */
+                           /* due to a false reference.  But not using   */
+                           /* the block risks unreasonable immediate     */
+                           /* heap growth.                               */
 
 /*********************************/
 /*                               */
-/* Stack saving for debugging   */
+/* Stack saving for debugging    */
 /*                               */
 /*********************************/
 
 #ifdef NEED_CALLINFO
     struct callinfo {
-       word ci_pc;     /* Caller, not callee, pc       */
-#      if NARGS > 0
-           word ci_arg[NARGS]; /* bit-wise complement to avoid retention */
-#      endif
-#      if (NFRAMES * (NARGS + 1)) % 2 == 1
-           /* Likely alignment problem. */
-           word ci_dummy;
-#      endif
+        word ci_pc;     /* Caller, not callee, pc       */
+#       if NARGS > 0
+            word ci_arg[NARGS]; /* bit-wise complement to avoid retention */
+#       endif
+#       if (NFRAMES * (NARGS + 1)) % 2 == 1
+            /* Likely alignment problem. */
+            word ci_dummy;
+#       endif
     };
 #endif
 
 #ifdef SAVE_CALL_CHAIN
 
-/* Fill in the pc and argument information for up to NFRAMES of my     */
-/* callers.  Ignore my frame and my callers frame.                     */
+/* Fill in the pc and argument information for up to NFRAMES of my      */
+/* callers.  Ignore my frame and my callers frame.                      */
 void GC_save_callers(struct callinfo info[NFRAMES]);
-  
+
 void GC_print_callers(struct callinfo info[NFRAMES]);
 
 #endif
@@ -231,7 +231,7 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 
 /*********************************/
 /*                               */
-/* OS interface routines        */
+/* OS interface routines         */
 /*                               */
 /*********************************/
 
@@ -241,10 +241,10 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 #   undef MS_TIME_DIFF
 #   define CLOCK_TYPE struct timeval
 #   define GET_TIME(x) { struct rusage rusage; \
-                        getrusage (RUSAGE_SELF,  &rusage); \
-                        x = rusage.ru_utime; }
+                         getrusage (RUSAGE_SELF,  &rusage); \
+                         x = rusage.ru_utime; }
 #   define MS_TIME_DIFF(a,b) \
-               ((unsigned long)((double) (a.tv_sec - b.tv_sec) * 1000.0 \
+                ((unsigned long)((double) (a.tv_sec - b.tv_sec) * 1000.0 \
                                + (double) (a.tv_usec - b.tv_usec) / 1000.0))
 #else /* !BSD_TIME */
 # if defined(MSWIN32) || defined(MSWINCE)
@@ -256,7 +256,7 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 # else /* !MSWIN32, !MSWINCE, !BSD_TIME */
 #   include <time.h>
 #   if !defined(__STDC__) && defined(SPARC) && defined(SUNOS4)
-      clock_t clock(void);     /* Not in time.h, where it belongs      */
+      clock_t clock(void);      /* Not in time.h, where it belongs      */
 #   endif
 #   if defined(FREEBSD) && !defined(CLOCKS_PER_SEC)
 #     include <machine/limits.h>
@@ -278,11 +278,11 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 #   define CLOCK_TYPE clock_t
 #   define GET_TIME(x) x = clock()
 #   define MS_TIME_DIFF(a,b) ((unsigned long) \
-               (1000.0*(double)((a)-(b))/(double)CLOCKS_PER_SEC))
+                (1000.0*(double)((a)-(b))/(double)CLOCKS_PER_SEC))
 # endif /* !MSWIN32 */
 #endif /* !BSD_TIME */
 
-/* We use bzero and bcopy internally.  They may not be available.      */
+/* We use bzero and bcopy internally.  They may not be available.       */
 # if defined(SPARC) && defined(SUNOS4)
 #   define BCOPY_EXISTS
 # endif
@@ -319,13 +319,13 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 # ifdef PCR
 #     include "th/PCR_ThCtl.h"
 #     define STOP_WORLD() \
-       PCR_ThCtl_SetExclusiveMode(PCR_ThCtl_ExclusiveMode_stopNormal, \
-                                  PCR_allSigsBlocked, \
-                                  PCR_waitForever)
+        PCR_ThCtl_SetExclusiveMode(PCR_ThCtl_ExclusiveMode_stopNormal, \
+                                   PCR_allSigsBlocked, \
+                                   PCR_waitForever)
 #     define START_WORLD() \
-       PCR_ThCtl_SetExclusiveMode(PCR_ThCtl_ExclusiveMode_null, \
-                                  PCR_allSigsBlocked, \
-                                  PCR_waitForever);
+        PCR_ThCtl_SetExclusiveMode(PCR_ThCtl_ExclusiveMode_null, \
+                                   PCR_allSigsBlocked, \
+                                   PCR_waitForever);
 # else
 #   if defined(GC_WIN32_THREADS) || defined(GC_PTHREADS)
       void GC_stop_world(void);
@@ -333,7 +333,7 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 #     define STOP_WORLD() GC_stop_world()
 #     define START_WORLD() GC_start_world()
 #   else
-       /* Just do a sanity check: we are not inside GC_do_blocking().  */
+        /* Just do a sanity check: we are not inside GC_do_blocking().  */
 #     define STOP_WORLD() GC_ASSERT(GC_blocked_sp == NULL)
 #     define START_WORLD()
 #   endif
@@ -344,19 +344,19 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 #   define ABORT(s) PCR_Base_Panic(s)
 # else
 #   if defined(MSWINCE) && !defined(UNDER_CE) && !defined(DebugBreak)
-      /* This simplifies linking for WinCE (and, probably, doesn't     */
-      /* hurt debugging much); use -DDebugBreak=DebugBreak to override */
-      /* this behavior if really needed.                               */
+      /* This simplifies linking for WinCE (and, probably, doesn't      */
+      /* hurt debugging much); use -DDebugBreak=DebugBreak to override  */
+      /* this behavior if really needed.                                */
 #     define DebugBreak() _exit(-1) /* there is no abort() in WinCE */
 #   endif
 #   ifdef SMALL_CONFIG
-#      if defined(MSWIN32) || defined(MSWINCE)
-#          define ABORT(msg) DebugBreak()
-#      else
-#          define ABORT(msg) abort()
-#      endif
+#       if defined(MSWIN32) || defined(MSWINCE)
+#           define ABORT(msg) DebugBreak()
+#       else
+#           define ABORT(msg) abort()
+#       endif
 #   else
-       GC_API_PRIV void GC_abort(const char * msg);
+        GC_API_PRIV void GC_abort(const char * msg);
 #       define ABORT(msg) GC_abort(msg)
 #   endif
 # endif
@@ -368,15 +368,15 @@ void GC_print_callers(struct callinfo info[NFRAMES]);
 #   define EXIT() (void)exit(1)
 # endif
 
-/* Print warning message, e.g. almost out of memory.   */
+/* Print warning message, e.g. almost out of memory.    */
 # define WARN(msg,arg) (*GC_current_warn_proc)("GC Warning: " msg, (GC_word)(arg))
 extern GC_warn_proc GC_current_warn_proc;
 
-/* Print format type macro for signed_word.  Currently used for WARN() */
-/* only.  This could be of use on Win64 but commented out since Win64  */
-/* is only a little-endian architecture (for now) and the WARN format  */
-/* string is, possibly, processed on the client side, so non-standard  */
-/* print type modifiers should be avoided (if possible).               */
+/* Print format type macro for signed_word.  Currently used for WARN()  */
+/* only.  This could be of use on Win64 but commented out since Win64   */
+/* is only a little-endian architecture (for now) and the WARN format   */
+/* string is, possibly, processed on the client side, so non-standard   */
+/* print type modifiers should be avoided (if possible).                */
 #if defined(_MSC_VER) && defined(_WIN64) && !defined(GC_PRIdPTR)
 /* #define GC_PRIdPTR "I64d" */
 #endif
@@ -395,14 +395,14 @@ extern GC_warn_proc GC_current_warn_proc;
 /* Get environment entry */
 #if !defined(NO_GETENV)
 #   if defined(EMPTY_GETENV_RESULTS)
-       /* Workaround for a reputed Wine bug.   */
-       static inline char * fixed_getenv(const char *name)
-       {
-         char * tmp = getenv(name);
-         if (tmp == 0 || strlen(tmp) == 0)
-           return 0;
-         return tmp;
-       }
+        /* Workaround for a reputed Wine bug.   */
+        static inline char * fixed_getenv(const char *name)
+        {
+          char * tmp = getenv(name);
+          if (tmp == 0 || strlen(tmp) == 0)
+            return 0;
+          return tmp;
+        }
 #       define GETENV(name) fixed_getenv(name)
 #   else
 #       define GETENV(name) getenv(name)
@@ -412,55 +412,55 @@ extern GC_warn_proc GC_current_warn_proc;
 #endif
 
 #if defined(DARWIN)
-#      if defined(POWERPC)
-#              if CPP_WORDSZ == 32
+#       if defined(POWERPC)
+#               if CPP_WORDSZ == 32
 #                 define GC_THREAD_STATE_T ppc_thread_state_t
-#                define GC_MACH_THREAD_STATE PPC_THREAD_STATE
-#                define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
-#                define GC_MACH_HEADER mach_header
-#                define GC_MACH_SECTION section
+#                 define GC_MACH_THREAD_STATE PPC_THREAD_STATE
+#                 define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
+#                 define GC_MACH_HEADER mach_header
+#                 define GC_MACH_SECTION section
 #                 define GC_GETSECTBYNAME getsectbynamefromheader
-#              else
+#               else
 #                 define GC_THREAD_STATE_T ppc_thread_state64_t
-#                define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
-#                define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
-#                define GC_MACH_HEADER mach_header_64
-#                define GC_MACH_SECTION section_64
+#                 define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
+#                 define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
+#                 define GC_MACH_HEADER mach_header_64
+#                 define GC_MACH_SECTION section_64
 #                 define GC_GETSECTBYNAME getsectbynamefromheader_64
-#              endif
-#      elif defined(I386) || defined(X86_64)
+#               endif
+#       elif defined(I386) || defined(X86_64)
 #               if CPP_WORDSZ == 32
-#                define GC_THREAD_STATE_T x86_thread_state32_t
-#                define GC_MACH_THREAD_STATE x86_THREAD_STATE32
-#                define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
-#                define GC_MACH_HEADER mach_header
-#                define GC_MACH_SECTION section
+#                 define GC_THREAD_STATE_T x86_thread_state32_t
+#                 define GC_MACH_THREAD_STATE x86_THREAD_STATE32
+#                 define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
+#                 define GC_MACH_HEADER mach_header
+#                 define GC_MACH_SECTION section
 #                 define GC_GETSECTBYNAME getsectbynamefromheader
 #               else
-#                define GC_THREAD_STATE_T x86_thread_state64_t
-#                define GC_MACH_THREAD_STATE x86_THREAD_STATE64
-#                define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
-#                define GC_MACH_HEADER mach_header_64
-#                define GC_MACH_SECTION section_64
+#                 define GC_THREAD_STATE_T x86_thread_state64_t
+#                 define GC_MACH_THREAD_STATE x86_THREAD_STATE64
+#                 define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
+#                 define GC_MACH_HEADER mach_header_64
+#                 define GC_MACH_SECTION section_64
 #                 define GC_GETSECTBYNAME getsectbynamefromheader_64
 #               endif
-#      else
-#              if defined(ARM32)
-#                define GC_THREAD_STATE_T arm_thread_state_t
-#              else
-#                error define GC_THREAD_STATE_T
-#              endif
-#              define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
-#              define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
-#      endif
+#       else
+#               if defined(ARM32)
+#                 define GC_THREAD_STATE_T arm_thread_state_t
+#               else
+#                 error define GC_THREAD_STATE_T
+#               endif
+#               define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
+#               define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
+#       endif
 /* Try to work out the right way to access thread state structure members.
    The structure has changed its definition in different Darwin versions.
    This now defaults to the (older) names without __, thus hopefully,
    not breaking any existing Makefile.direct builds.  */
 #       if defined (HAS_PPC_THREAD_STATE___R0) \
-         || defined (HAS_PPC_THREAD_STATE64___R0) \
-         || defined (HAS_X86_THREAD_STATE32___EAX) \
-         || defined (HAS_X86_THREAD_STATE64___RAX)
+          || defined (HAS_PPC_THREAD_STATE64___R0) \
+          || defined (HAS_X86_THREAD_STATE32___EAX) \
+          || defined (HAS_X86_THREAD_STATE64___RAX)
 #         define THREAD_FLD(x) __ ## x
 #       else
 #         define THREAD_FLD(x) x
@@ -477,9 +477,9 @@ extern GC_warn_proc GC_current_warn_proc;
 #  define WORDS_TO_BYTES(x)   ((x)<<2)
 #  define BYTES_TO_WORDS(x)   ((x)>>2)
 #  define LOGWL               ((word)5)    /* log[2] of CPP_WORDSZ */
-#  define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word           */
+#  define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word            */
 #  if ALIGNMENT != 4
-#      define UNALIGNED_PTRS
+#       define UNALIGNED_PTRS
 #  endif
 #endif
 
@@ -487,17 +487,17 @@ extern GC_warn_proc GC_current_warn_proc;
 #  define WORDS_TO_BYTES(x)   ((x)<<3)
 #  define BYTES_TO_WORDS(x)   ((x)>>3)
 #  define LOGWL               ((word)6)    /* log[2] of CPP_WORDSZ */
-#  define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word           */
+#  define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word            */
 #  if ALIGNMENT != 8
-#      define UNALIGNED_PTRS
+#       define UNALIGNED_PTRS
 #  endif
 #endif
 
-/* The first TINY_FREELISTS free lists correspond to the first */
-/* TINY_FREELISTS multiples of GRANULE_BYTES, i.e. we keep     */
-/* separate free lists for each multiple of GRANULE_BYTES      */
-/* up to (TINY_FREELISTS-1) * GRANULE_BYTES.  After that they  */
-/* may be spread out further.                                  */
+/* The first TINY_FREELISTS free lists correspond to the first  */
+/* TINY_FREELISTS multiples of GRANULE_BYTES, i.e. we keep      */
+/* separate free lists for each multiple of GRANULE_BYTES       */
+/* up to (TINY_FREELISTS-1) * GRANULE_BYTES.  After that they   */
+/* may be spread out further.                                   */
 #include "../gc_tiny_fl.h"
 #define GRANULE_BYTES GC_GRANULE_BYTES
 #define TINY_FREELISTS GC_TINY_FREELISTS
@@ -506,7 +506,7 @@ extern GC_warn_proc GC_current_warn_proc;
 #define SIGNB  ((word)1 << (WORDSZ-1))
 #define BYTES_PER_WORD      ((word)(sizeof (word)))
 #define ONES                ((word)(signed_word)(-1))
-#define divWORDSZ(n) ((n) >> LOGWL)       /* divide n by size of word      */
+#define divWORDSZ(n) ((n) >> LOGWL)        /* divide n by size of word      */
 
 #if GRANULE_BYTES == 8
 # define BYTES_TO_GRANULES(n) ((n)>>3)
@@ -538,13 +538,13 @@ extern GC_warn_proc GC_current_warn_proc;
 /*                   */
 /*********************/
 
-/*  Heap block size, bytes. Should be power of 2.              */
-/* Incremental GC with MPROTECT_VDB currently requires the     */
-/* page size to be a multiple of HBLKSIZE.  Since most modern  */
-/* architectures support variable page sizes down to 4K, and   */
-/* X86 is generally 4K, we now default to 4K, except for       */
-/*   Alpha: Seems to be used with 8K pages.                    */
-/*   SMALL_CONFIG: Want less block-level fragmentation.                */
+/*  Heap block size, bytes. Should be power of 2.               */
+/* Incremental GC with MPROTECT_VDB currently requires the      */
+/* page size to be a multiple of HBLKSIZE.  Since most modern   */
+/* architectures support variable page sizes down to 4K, and    */
+/* X86 is generally 4K, we now default to 4K, except for        */
+/*   Alpha: Seems to be used with 8K pages.                     */
+/*   SMALL_CONFIG: Want less block-level fragmentation.         */
 
 #ifndef HBLKSIZE
 # ifdef SMALL_CONFIG
@@ -586,9 +586,9 @@ extern GC_warn_proc GC_current_warn_proc;
 # define HBLKSIZE ((size_t)CPP_HBLKSIZE)
 
 
-/*  max size objects supported by freelist (larger objects are */
+/*  max size objects supported by freelist (larger objects are  */
 /*  allocated directly with allchblk(), by rounding to the next */
-/*  multiple of HBLKSIZE.                                      */
+/*  multiple of HBLKSIZE.                                       */
 
 #define CPP_MAXOBJBYTES (CPP_HBLKSIZE/2)
 #define MAXOBJBYTES ((size_t)CPP_MAXOBJBYTES)
@@ -596,38 +596,38 @@ extern GC_warn_proc GC_current_warn_proc;
 #define MAXOBJWORDS ((size_t)CPP_MAXOBJWORDS)
 #define CPP_MAXOBJGRANULES BYTES_TO_GRANULES(CPP_MAXOBJBYTES)
 #define MAXOBJGRANULES ((size_t)CPP_MAXOBJGRANULES)
-               
+
 # define divHBLKSZ(n) ((n) >> LOG_HBLKSIZE)
 
 # define HBLK_PTR_DIFF(p,q) divHBLKSZ((ptr_t)p - (ptr_t)q)
-       /* Equivalent to subtracting 2 hblk pointers.   */
-       /* We do it this way because a compiler should  */
-       /* find it hard to use an integer division      */
-       /* instead of a shift.  The bundled SunOS 4.1   */
-       /* o.w. sometimes pessimizes the subtraction to */
-       /* involve a call to .div.                      */
+        /* Equivalent to subtracting 2 hblk pointers.   */
+        /* We do it this way because a compiler should  */
+        /* find it hard to use an integer division      */
+        /* instead of a shift.  The bundled SunOS 4.1   */
+        /* o.w. sometimes pessimizes the subtraction to */
+        /* involve a call to .div.                      */
+
 # define modHBLKSZ(n) ((n) & (HBLKSIZE-1))
+
 # define HBLKPTR(objptr) ((struct hblk *)(((word) (objptr)) & ~(HBLKSIZE-1)))
 
 # define HBLKDISPL(objptr) (((size_t) (objptr)) & (HBLKSIZE-1))
 
 /* Round up byte allocation requests to integral number of words, etc. */
 # define ROUNDED_UP_GRANULES(n) \
-       BYTES_TO_GRANULES((n) + (GRANULE_BYTES - 1 + EXTRA_BYTES))
+        BYTES_TO_GRANULES((n) + (GRANULE_BYTES - 1 + EXTRA_BYTES))
 # if MAX_EXTRA_BYTES == 0
 #  define SMALL_OBJ(bytes) EXPECT((bytes) <= (MAXOBJBYTES), 1)
 # else
 #  define SMALL_OBJ(bytes) \
-           (EXPECT((bytes) <= (MAXOBJBYTES - MAX_EXTRA_BYTES), 1) || \
-            (bytes) <= (MAXOBJBYTES - EXTRA_BYTES))
-       /* This really just tests bytes <= MAXOBJBYTES - EXTRA_BYTES.   */
-       /* But we try to avoid looking up EXTRA_BYTES.                  */
+            (EXPECT((bytes) <= (MAXOBJBYTES - MAX_EXTRA_BYTES), 1) || \
+             (bytes) <= (MAXOBJBYTES - EXTRA_BYTES))
+        /* This really just tests bytes <= MAXOBJBYTES - EXTRA_BYTES.   */
+        /* But we try to avoid looking up EXTRA_BYTES.                  */
 # endif
 # define ADD_SLOP(bytes) ((bytes) + EXTRA_BYTES)
 # ifndef MIN_WORDS
-#  define MIN_WORDS 2  /* FIXME: obsolete */
+#  define MIN_WORDS 2   /* FIXME: obsolete */
 # endif
 
 
@@ -639,32 +639,32 @@ extern GC_warn_proc GC_current_warn_proc;
  * addresses are represented by a single location.
  * Used by black-listing code, and perhaps by dirty bit maintenance code.
  */
+
 # ifdef LARGE_CONFIG
 #   if CPP_WORDSZ == 32
-#    define LOG_PHT_ENTRIES  20 /* Collisions likely at 1M blocks,     */
-                               /* which is >= 4GB.  Each table takes   */
-                               /* 128KB, some of which may never be    */
-                               /* touched.                             */
+#    define LOG_PHT_ENTRIES  20 /* Collisions likely at 1M blocks,      */
+                                /* which is >= 4GB.  Each table takes   */
+                                /* 128KB, some of which may never be    */
+                                /* touched.                             */
 #   else
-#    define LOG_PHT_ENTRIES  21 /* Collisions likely at 2M blocks,     */
-                               /* which is >= 8GB.  Each table takes   */
-                               /* 256KB, some of which may never be    */
-                               /* touched.                             */
+#    define LOG_PHT_ENTRIES  21 /* Collisions likely at 2M blocks,      */
+                                /* which is >= 8GB.  Each table takes   */
+                                /* 256KB, some of which may never be    */
+                                /* touched.                             */
 #   endif
 # else
 #   ifdef SMALL_CONFIG
-#     define LOG_PHT_ENTRIES  15 /* Collisions are likely if heap grows        */
-                                /* to more than 32K hblks = 128MB.     */
-                                /* Each hash table occupies 4K bytes.  */
+#     define LOG_PHT_ENTRIES  15 /* Collisions are likely if heap grows */
+                                 /* to more than 32K hblks = 128MB.     */
+                                 /* Each hash table occupies 4K bytes.  */
 #   else /* default "medium" configuration */
-#     define LOG_PHT_ENTRIES  18 /* Collisions are likely if heap grows        */
-                                /* to more than 256K hblks >= 1GB.     */
-                                /* Each hash table occupies 32K bytes. */
-                                /* Even for somewhat smaller heaps,    */
-                                /* say half that, collisions may be an */
-                                /* issue because we blacklist          */
-                                /* addresses outside the heap.         */
+#     define LOG_PHT_ENTRIES  18 /* Collisions are likely if heap grows */
+                                 /* to more than 256K hblks >= 1GB.     */
+                                 /* Each hash table occupies 32K bytes. */
+                                 /* Even for somewhat smaller heaps,    */
+                                 /* say half that, collisions may be an */
+                                 /* issue because we blacklist          */
+                                 /* addresses outside the heap.         */
 #   endif
 # endif
 # define PHT_ENTRIES ((word)1 << LOG_PHT_ENTRIES)
@@ -674,16 +674,16 @@ typedef word page_hash_table[PHT_SIZE];
 # define PHT_HASH(addr) ((((word)(addr)) >> LOG_HBLKSIZE) & (PHT_ENTRIES - 1))
 
 # define get_pht_entry_from_index(bl, index) \
-               (((bl)[divWORDSZ(index)] >> modWORDSZ(index)) & 1)
+                (((bl)[divWORDSZ(index)] >> modWORDSZ(index)) & 1)
 # define set_pht_entry_from_index(bl, index) \
-               (bl)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index)
+                (bl)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index)
 # define clear_pht_entry_from_index(bl, index) \
-               (bl)[divWORDSZ(index)] &= ~((word)1 << modWORDSZ(index))
-/* And a dumb but thread-safe version of set_pht_entry_from_index.     */
-/* This sets (many) extra bits.                                                */
+                (bl)[divWORDSZ(index)] &= ~((word)1 << modWORDSZ(index))
+/* And a dumb but thread-safe version of set_pht_entry_from_index.      */
+/* This sets (many) extra bits.                                         */
 # define set_pht_entry_from_index_safe(bl, index) \
-               (bl)[divWORDSZ(index)] = ONES
-       
+                (bl)[divWORDSZ(index)] = ONES
+
 
 
 /********************************************/
@@ -696,22 +696,22 @@ typedef word page_hash_table[PHT_SIZE];
 #define HBLKMASK   (HBLKSIZE-1)
 
 #define MARK_BITS_PER_HBLK (HBLKSIZE/GRANULE_BYTES)
-          /* upper bound                                    */
-          /* We allocate 1 bit per allocation granule.      */
-          /* If MARK_BIT_PER_GRANULE is defined, we use     */
-          /* every nth bit, where n is the number of        */
-          /* allocation granules per object.  If            */
-          /* MARK_BIT_PER_OBJ is defined, we only use the   */
-          /* initial group of mark bits, and it is safe     */
-          /* to allocate smaller header for large objects.  */
+           /* upper bound                                    */
+           /* We allocate 1 bit per allocation granule.      */
+           /* If MARK_BIT_PER_GRANULE is defined, we use     */
+           /* every nth bit, where n is the number of        */
+           /* allocation granules per object.  If            */
+           /* MARK_BIT_PER_OBJ is defined, we only use the   */
+           /* initial group of mark bits, and it is safe     */
+           /* to allocate smaller header for large objects.  */
 
 # ifdef USE_MARK_BYTES
 #   define MARK_BITS_SZ (MARK_BITS_PER_HBLK + 1)
-       /* Unlike the other case, this is in units of bytes.            */
-       /* Since we force doubleword alignment, we need at most one     */
-       /* mark bit per 2 words.  But we do allocate and set one        */
-       /* extra mark bit to avoid an explicit check for the            */
-       /* partial object at the end of each block.                     */
+        /* Unlike the other case, this is in units of bytes.            */
+        /* Since we force doubleword alignment, we need at most one     */
+        /* mark bit per 2 words.  But we do allocate and set one        */
+        /* extra mark bit to avoid an explicit check for the            */
+        /* partial object at the end of each block.                     */
 # else
 #   define MARK_BITS_SZ (MARK_BITS_PER_HBLK/CPP_WORDSZ + 1)
 # endif
@@ -724,85 +724,85 @@ typedef word page_hash_table[PHT_SIZE];
 #endif
 
 /* We maintain layout maps for heap blocks containing objects of a given */
-/* size.  Each entry in this map describes a byte offset and has the    */
-/* following type.                                                      */
+/* size.  Each entry in this map describes a byte offset and has the     */
+/* following type.                                                       */
 struct hblkhdr {
-    struct hblk * hb_next;     /* Link field for hblk free list         */
-                               /* and for lists of chunks waiting to be */
-                               /* reclaimed.                            */
-    struct hblk * hb_prev;     /* Backwards link for free list.        */
-    struct hblk * hb_block;    /* The corresponding block.             */
+    struct hblk * hb_next;      /* Link field for hblk free list         */
+                                /* and for lists of chunks waiting to be */
+                                /* reclaimed.                            */
+    struct hblk * hb_prev;      /* Backwards link for free list.        */
+    struct hblk * hb_block;     /* The corresponding block.             */
     unsigned char hb_obj_kind;
-                        /* Kind of objects in the block.  Each kind    */
-                        /* identifies a mark procedure and a set of    */
-                        /* list headers.  Sometimes called regions.    */
+                         /* Kind of objects in the block.  Each kind    */
+                         /* identifies a mark procedure and a set of    */
+                         /* list headers.  Sometimes called regions.    */
     unsigned char hb_flags;
-#      define IGNORE_OFF_PAGE  1       /* Ignore pointers that do not  */
-                                       /* point to the first page of   */
-                                       /* this object.                 */
-#      define WAS_UNMAPPED 2   /* This is a free block, which has      */
-                               /* been unmapped from the address       */
-                               /* space.                               */
-                               /* GC_remap must be invoked on it       */
-                               /* before it can be reallocated.        */
-                               /* Only set with USE_MUNMAP.            */
-#      define FREE_BLK 4       /* Block is free, i.e. not in use.      */
+#       define IGNORE_OFF_PAGE  1       /* Ignore pointers that do not  */
+                                        /* point to the first page of   */
+                                        /* this object.                 */
+#       define WAS_UNMAPPED 2   /* This is a free block, which has      */
+                                /* been unmapped from the address       */
+                                /* space.                               */
+                                /* GC_remap must be invoked on it       */
+                                /* before it can be reallocated.        */
+                                /* Only set with USE_MUNMAP.            */
+#       define FREE_BLK 4       /* Block is free, i.e. not in use.      */
     unsigned short hb_last_reclaimed;
-                               /* Value of GC_gc_no when block was     */
-                               /* last allocated or swept. May wrap.   */
-                               /* For a free block, this is maintained */
-                               /* only for USE_MUNMAP, and indicates   */
-                               /* when the header was allocated, or    */
-                               /* when the size of the block last      */
-                               /* changed.                             */
+                                /* Value of GC_gc_no when block was     */
+                                /* last allocated or swept. May wrap.   */
+                                /* For a free block, this is maintained */
+                                /* only for USE_MUNMAP, and indicates   */
+                                /* when the header was allocated, or    */
+                                /* when the size of the block last      */
+                                /* changed.                             */
     size_t hb_sz;  /* If in use, size in bytes, of objects in the block. */
-                  /* if free, the size in bytes of the whole block      */
-                  /* We assume that this is convertible to signed_word  */
-                  /* without generating a negative result.  We avoid    */
-                  /* generating free blocks larger than that.           */
-    word hb_descr;             /* object descriptor for marking.  See  */
-                               /* mark.h.                              */
+                   /* if free, the size in bytes of the whole block      */
+                   /* We assume that this is convertible to signed_word  */
+                   /* without generating a negative result.  We avoid    */
+                   /* generating free blocks larger than that.           */
+    word hb_descr;              /* object descriptor for marking.  See  */
+                                /* mark.h.                              */
 #   ifdef MARK_BIT_PER_OBJ
-      unsigned32 hb_inv_sz;    /* A good upper bound for 2**32/hb_sz.  */
-                               /* For large objects, we use            */
-                               /* LARGE_INV_SZ.                        */
+      unsigned32 hb_inv_sz;     /* A good upper bound for 2**32/hb_sz.  */
+                                /* For large objects, we use            */
+                                /* LARGE_INV_SZ.                        */
 #     define LARGE_INV_SZ (1 << 16)
 #   else
       unsigned char hb_large_block;
-      short * hb_map;          /* Essentially a table of remainders    */
-                               /* mod BYTES_TO_GRANULES(hb_sz), except */
-                               /* for large blocks.  See GC_obj_map.   */
+      short * hb_map;           /* Essentially a table of remainders    */
+                                /* mod BYTES_TO_GRANULES(hb_sz), except */
+                                /* for large blocks.  See GC_obj_map.   */
 #   endif
-    counter_t hb_n_marks;      /* Number of set mark bits, excluding   */
-                               /* the one always set at the end.       */
-                               /* Currently it is concurrently         */
-                               /* updated and hence only approximate.  */
-                               /* But a zero value does guarantee that */
-                               /* the block contains no marked         */
-                               /* objects.                             */
-                               /* Ensuring this property means that we */
-                               /* never decrement it to zero during a  */
-                               /* collection, and hence the count may  */
-                               /* be one too high.  Due to concurrent  */
-                               /* updates, an arbitrary number of      */
-                               /* increments, but not all of them (!)  */
-                               /* may be lost, hence it may in theory  */
-                               /* be much too low.                     */
-                               /* The count may also be too high if    */
-                               /* multiple mark threads mark the       */
-                               /* same object due to a race.           */
-                               /* Without parallel marking, the count  */
-                               /* is accurate.                         */
+    counter_t hb_n_marks;       /* Number of set mark bits, excluding   */
+                                /* the one always set at the end.       */
+                                /* Currently it is concurrently         */
+                                /* updated and hence only approximate.  */
+                                /* But a zero value does guarantee that */
+                                /* the block contains no marked         */
+                                /* objects.                             */
+                                /* Ensuring this property means that we */
+                                /* never decrement it to zero during a  */
+                                /* collection, and hence the count may  */
+                                /* be one too high.  Due to concurrent  */
+                                /* updates, an arbitrary number of      */
+                                /* increments, but not all of them (!)  */
+                                /* may be lost, hence it may in theory  */
+                                /* be much too low.                     */
+                                /* The count may also be too high if    */
+                                /* multiple mark threads mark the       */
+                                /* same object due to a race.           */
+                                /* Without parallel marking, the count  */
+                                /* is accurate.                         */
 #   ifdef USE_MARK_BYTES
       union {
         char _hb_marks[MARK_BITS_SZ];
-                           /* The i'th byte is 1 if the object         */
-                           /* starting at granule i or object i is     */
-                           /* marked, 0 o.w.                           */
-                           /* The mark bit for the "one past the       */
-                           /* end" object is always set to avoid a     */
-                           /* special case test in the marker.         */
-       word dummy;     /* Force word alignment of mark bytes. */
+                            /* The i'th byte is 1 if the object         */
+                            /* starting at granule i or object i is     */
+                            /* marked, 0 o.w.                           */
+                            /* The mark bit for the "one past the       */
+                            /* end" object is always set to avoid a     */
+                            /* special case test in the marker.         */
+        word dummy;     /* Force word alignment of mark bytes. */
       } _mark_byte_union;
 #     define hb_marks _mark_byte_union._hb_marks
 #   else
@@ -810,15 +810,15 @@ struct hblkhdr {
 #   endif /* !USE_MARK_BYTES */
 };
 
-# define ANY_INDEX 23  /* "Random" mark bit index for assertions */
+# define ANY_INDEX 23   /* "Random" mark bit index for assertions */
 
 /*  heap block body */
 
 # define HBLK_WORDS (HBLKSIZE/sizeof(word))
 # define HBLK_GRANULES (HBLKSIZE/GRANULE_BYTES)
 
-/* The number of objects in a block dedicated to a certain size.       */
-/* may erroneously yield zero (instead of one) for large objects.      */
+/* The number of objects in a block dedicated to a certain size.        */
+/* may erroneously yield zero (instead of one) for large objects.       */
 # define HBLK_OBJS(sz_in_bytes) (HBLKSIZE/(sz_in_bytes))
 
 struct hblk {
@@ -828,8 +828,8 @@ struct hblk {
 # define HBLK_IS_FREE(hdr) (((hdr) -> hb_flags & FREE_BLK) != 0)
 
 # define OBJ_SZ_TO_BLOCKS(sz) divHBLKSZ((sz) + HBLKSIZE-1)
-    /* Size of block (in units of HBLKSIZE) needed to hold objects of  */
-    /* given sz (in bytes).                                            */
+    /* Size of block (in units of HBLKSIZE) needed to hold objects of   */
+    /* given sz (in bytes).                                             */
 
 /* Object free list link */
 # define obj_link(p) (*(void  **)(p))
@@ -837,10 +837,10 @@ struct hblk {
 # define LOG_MAX_MARK_PROCS 6
 # define MAX_MARK_PROCS (1 << LOG_MAX_MARK_PROCS)
 
-/* Root sets.  Logically private to mark_rts.c.  But we don't want the */
-/* tables scanned, so we put them here.                                        */
-/* MAX_ROOT_SETS is the maximum number of ranges that can be   */
-/* registered as static roots.                                         */
+/* Root sets.  Logically private to mark_rts.c.  But we don't want the  */
+/* tables scanned, so we put them here.                                 */
+/* MAX_ROOT_SETS is the maximum number of ranges that can be    */
+/* registered as static roots.                                  */
 # ifdef LARGE_CONFIG
 #   define MAX_ROOT_SETS 8192
 # else
@@ -852,7 +852,7 @@ struct hblk {
 # endif
 
 # define MAX_EXCLUSIONS (MAX_ROOT_SETS/4)
-/* Maximum number of segments that can be excluded from root sets.     */
+/* Maximum number of segments that can be excluded from root sets.      */
 
 /*
  * Data structure for excluded static roots.
@@ -862,190 +862,190 @@ struct exclusion {
     ptr_t e_end;
 };
 
-/* Data structure for list of root sets.                               */
-/* We keep a hash table, so that we can filter out duplicate additions.        */
-/* Under Win32, we need to do a better job of filtering overlaps, so   */
-/* we resort to sequential search, and pay the price.                  */
+/* Data structure for list of root sets.                                */
+/* We keep a hash table, so that we can filter out duplicate additions. */
+/* Under Win32, we need to do a better job of filtering overlaps, so    */
+/* we resort to sequential search, and pay the price.                   */
 struct roots {
-       ptr_t r_start;/* multiple of word size */
-       ptr_t r_end;  /* multiple of word size and greater than r_start */
-#      if !defined(MSWIN32) && !defined(MSWINCE)
-         struct roots * r_next;
-#      endif
-       GC_bool r_tmp;
-               /* Delete before registering new dynamic libraries */
+        ptr_t r_start;/* multiple of word size */
+        ptr_t r_end;  /* multiple of word size and greater than r_start */
+#       if !defined(MSWIN32) && !defined(MSWINCE)
+          struct roots * r_next;
+#       endif
+        GC_bool r_tmp;
+                /* Delete before registering new dynamic libraries */
 };
 
 #if !defined(MSWIN32) && !defined(MSWINCE)
-    /* Size of hash table index to roots.      */
+    /* Size of hash table index to roots.       */
 #   define LOG_RT_SIZE 6
 #   define RT_SIZE (1 << LOG_RT_SIZE) /* Power of 2, may be != MAX_ROOT_SETS */
 #endif
 
-/* Lists of all heap blocks and free lists     */
-/* as well as other random data structures     */
-/* that should not be scanned by the           */
-/* collector.                                  */
-/* These are grouped together in a struct      */
-/* so that they can be easily skipped by the   */
-/* GC_mark routine.                            */
-/* The ordering is weird to make GC_malloc     */
-/* faster by keeping the important fields      */
-/* sufficiently close together that a          */
-/* single load of a base register will do.     */
-/* Scalars that could easily appear to         */
-/* be pointers are also put here.              */
-/* The main fields should precede any          */
-/* conditionally included fields, so that      */
-/* gc_inl.h will work even if a different set  */
-/* of macros is defined when the client is     */
-/* compiled.                                   */
+/* Lists of all heap blocks and free lists      */
+/* as well as other random data structures      */
+/* that should not be scanned by the            */
+/* collector.                                   */
+/* These are grouped together in a struct       */
+/* so that they can be easily skipped by the    */
+/* GC_mark routine.                             */
+/* The ordering is weird to make GC_malloc      */
+/* faster by keeping the important fields       */
+/* sufficiently close together that a           */
+/* single load of a base register will do.      */
+/* Scalars that could easily appear to          */
+/* be pointers are also put here.               */
+/* The main fields should precede any           */
+/* conditionally included fields, so that       */
+/* gc_inl.h will work even if a different set   */
+/* of macros is defined when the client is      */
+/* compiled.                                    */
 
 struct _GC_arrays {
-  word _heapsize;              /* Heap size in bytes.                  */
+  word _heapsize;               /* Heap size in bytes.                  */
   word _max_heapsize;
-  word _requested_heapsize;    /* Heap size due to explicit expansion */
+  word _requested_heapsize;     /* Heap size due to explicit expansion */
   ptr_t _last_heap_addr;
   ptr_t _prev_heap_addr;
   word _large_free_bytes;
-       /* Total bytes contained in blocks on large object free */
-       /* list.                                                */
+        /* Total bytes contained in blocks on large object free */
+        /* list.                                                */
   word _large_allocd_bytes;
-       /* Total number of bytes in allocated large objects blocks.     */
-       /* For the purposes of this counter and the next one only, a    */
-       /* large object is one that occupies a block of at least        */
-       /* 2*HBLKSIZE.                                                  */
+        /* Total number of bytes in allocated large objects blocks.     */
+        /* For the purposes of this counter and the next one only, a    */
+        /* large object is one that occupies a block of at least        */
+        /* 2*HBLKSIZE.                                                  */
   word _max_large_allocd_bytes;
-       /* Maximum number of bytes that were ever allocated in          */
-       /* large object blocks.  This is used to help decide when it    */
-       /* is safe to split up a large block.                           */
+        /* Maximum number of bytes that were ever allocated in          */
+        /* large object blocks.  This is used to help decide when it    */
+        /* is safe to split up a large block.                           */
   word _bytes_allocd_before_gc;
-               /* Number of words allocated before this        */
-               /* collection cycle.                            */
+                /* Number of words allocated before this        */
+                /* collection cycle.                            */
 # ifndef SEPARATE_GLOBALS
     word _bytes_allocd;
-       /* Number of words allocated during this collection cycle */
+        /* Number of words allocated during this collection cycle */
 # endif
   word _bytes_dropped;
-       /* Number of black-listed bytes dropped during GC cycle */
-       /* as a result of repeated scanning during allocation   */
-       /* attempts.  These are treated largely as allocated,   */
-       /* even though they are not useful to the client.       */
+        /* Number of black-listed bytes dropped during GC cycle */
+        /* as a result of repeated scanning during allocation   */
+        /* attempts.  These are treated largely as allocated,   */
+        /* even though they are not useful to the client.       */
   word _bytes_finalized;
-       /* Approximate number of bytes in objects (and headers) */
-       /* that became ready for finalization in the last       */
-       /* collection.                                          */
+        /* Approximate number of bytes in objects (and headers) */
+        /* that became ready for finalization in the last       */
+        /* collection.                                          */
   word _non_gc_bytes_at_gc;
-       /* Number of explicitly managed bytes of storage        */
-       /* at last collection.                                  */
+        /* Number of explicitly managed bytes of storage        */
+        /* at last collection.                                  */
   word _bytes_freed;
-       /* Number of explicitly deallocated bytes of memory     */
-       /* since last collection.                               */
+        /* Number of explicitly deallocated bytes of memory     */
+        /* since last collection.                               */
   word _finalizer_bytes_freed;
-       /* Bytes of memory explicitly deallocated while         */
-       /* finalizers were running.  Used to approximate mem.   */
-       /* explicitly deallocated by finalizers.                */
+        /* Bytes of memory explicitly deallocated while         */
+        /* finalizers were running.  Used to approximate mem.   */
+        /* explicitly deallocated by finalizers.                */
   ptr_t _scratch_end_ptr;
   ptr_t _scratch_last_end_ptr;
-       /* Used by headers.c, and can easily appear to point to */
-       /* heap.                                                */
+        /* Used by headers.c, and can easily appear to point to */
+        /* heap.                                                */
   GC_mark_proc _mark_procs[MAX_MARK_PROCS];
-       /* Table of user-defined mark procedures.  There is     */
-       /* a small number of these, which can be referenced     */
-       /* by DS_PROC mark descriptors.  See gc_mark.h.         */
+        /* Table of user-defined mark procedures.  There is     */
+        /* a small number of these, which can be referenced     */
+        /* by DS_PROC mark descriptors.  See gc_mark.h.         */
 
 # ifndef SEPARATE_GLOBALS
     void *_objfreelist[MAXOBJGRANULES+1];
-                         /* free list for objects */
+                          /* free list for objects */
     void *_aobjfreelist[MAXOBJGRANULES+1];
-                         /* free list for atomic objs  */
+                          /* free list for atomic objs  */
 # endif
 
   void *_uobjfreelist[MAXOBJGRANULES+1];
-                         /* uncollectable but traced objs      */
-                         /* objects on this and auobjfreelist  */
-                         /* are always marked, except during   */
-                         /* garbage collections.               */
+                          /* uncollectable but traced objs      */
+                          /* objects on this and auobjfreelist  */
+                          /* are always marked, except during   */
+                          /* garbage collections.               */
 # ifdef ATOMIC_UNCOLLECTABLE
     void *_auobjfreelist[MAXOBJGRANULES+1];
 # endif
-                         /* uncollectable but traced objs      */
+                          /* uncollectable but traced objs      */
 
     word _composite_in_use;
-               /* Number of words in accessible composite      */
-               /* objects.                                     */
+                /* Number of words in accessible composite      */
+                /* objects.                                     */
     word _atomic_in_use;
-               /* Number of words in accessible atomic         */
-               /* objects.                                     */
+                /* Number of words in accessible atomic         */
+                /* objects.                                     */
 # ifdef USE_MUNMAP
     word _unmapped_bytes;
 # endif
 
     size_t _size_map[MAXOBJBYTES+1];
-       /* Number of granules to allocate when asked for a certain      */
-       /* number of bytes.                                             */
+        /* Number of granules to allocate when asked for a certain      */
+        /* number of bytes.                                             */
 
 # ifdef STUBBORN_ALLOC
     ptr_t _sobjfreelist[MAXOBJGRANULES+1];
 # endif
-                         /* free list for immutable objects    */
+                          /* free list for immutable objects    */
 # ifdef MARK_BIT_PER_GRANULE
     short * _obj_map[MAXOBJGRANULES+1];
                        /* If not NIL, then a pointer to a map of valid  */
-                      /* object addresses.                             */
-                      /* _obj_map[sz_in_granules][i] is                */
-                      /* i % sz_in_granules.                           */
-                      /* This is now used purely to replace a          */
-                      /* division in the marker by a table lookup.     */
-                      /* _obj_map[0] is used for large objects and     */
-                      /* contains all nonzero entries.  This gets us   */
-                      /* out of the marker fast path without an extra  */
-                      /* test.                                         */
+                       /* object addresses.                             */
+                       /* _obj_map[sz_in_granules][i] is                */
+                       /* i % sz_in_granules.                           */
+                       /* This is now used purely to replace a          */
+                       /* division in the marker by a table lookup.     */
+                       /* _obj_map[0] is used for large objects and     */
+                       /* contains all nonzero entries.  This gets us   */
+                       /* out of the marker fast path without an extra  */
+                       /* test.                                         */
 #   define MAP_LEN BYTES_TO_GRANULES(HBLKSIZE)
 # endif
 #   define VALID_OFFSET_SZ HBLKSIZE
   char _valid_offsets[VALID_OFFSET_SZ];
-                               /* GC_valid_offsets[i] == TRUE ==> i    */
-                               /* is registered as a displacement.     */
+                                /* GC_valid_offsets[i] == TRUE ==> i    */
+                                /* is registered as a displacement.     */
   char _modws_valid_offsets[sizeof(word)];
-                               /* GC_valid_offsets[i] ==>                */
-                               /* GC_modws_valid_offsets[i%sizeof(word)] */
+                                /* GC_valid_offsets[i] ==>                */
+                                /* GC_modws_valid_offsets[i%sizeof(word)] */
 # ifdef STUBBORN_ALLOC
     page_hash_table _changed_pages;
-        /* Stubborn object pages that were changes since last call to  */
-       /* GC_read_changed.                                             */
+        /* Stubborn object pages that were changes since last call to   */
+        /* GC_read_changed.                                             */
     page_hash_table _prev_changed_pages;
-        /* Stubborn object pages that were changes before last call to */
-       /* GC_read_changed.                                             */
+        /* Stubborn object pages that were changes before last call to  */
+        /* GC_read_changed.                                             */
 # endif
 # if defined(PROC_VDB) || defined(MPROTECT_VDB) || \
      defined(GWW_VDB) || defined(MANUAL_VDB)
-    page_hash_table _grungy_pages; /* Pages that were dirty at last       */
-                                    /* GC_read_dirty.                     */
+    page_hash_table _grungy_pages; /* Pages that were dirty at last        */
+                                     /* GC_read_dirty.                     */
 # endif
 # if defined(MPROTECT_VDB) || defined(MANUAL_VDB)
-    volatile page_hash_table _dirty_pages;     
-                       /* Pages dirtied since last GC_read_dirty. */
+    volatile page_hash_table _dirty_pages;
+                        /* Pages dirtied since last GC_read_dirty. */
 # endif
 # if defined(PROC_VDB) || defined(GWW_VDB)
-    page_hash_table _written_pages;    /* Pages ever dirtied   */
+    page_hash_table _written_pages;     /* Pages ever dirtied   */
 # endif
 
 #ifndef MAX_HEAP_SECTS
 # ifdef LARGE_CONFIG
 #   if CPP_WORDSZ > 32
-#     define MAX_HEAP_SECTS 8192       /* overflows at roughly 128 GB     */
+#     define MAX_HEAP_SECTS 8192        /* overflows at roughly 128 GB     */
 #   else
-#     define MAX_HEAP_SECTS 768                /* Separately added heap sections. */
+#     define MAX_HEAP_SECTS 768         /* Separately added heap sections. */
 #   endif
 # else
 #   ifdef SMALL_CONFIG
-#     define MAX_HEAP_SECTS 128                /* Roughly 256MB (128*2048*1K)  */
+#     define MAX_HEAP_SECTS 128         /* Roughly 256MB (128*2048*1K)  */
 #   else
 #     if CPP_WORDSZ > 32
-#       define MAX_HEAP_SECTS 1024     /* Roughly 8GB                   */
+#       define MAX_HEAP_SECTS 1024      /* Roughly 8GB                   */
 #     else
-#       define MAX_HEAP_SECTS 512      /* Roughly 4GB                   */
+#       define MAX_HEAP_SECTS 512       /* Roughly 4GB                   */
 #     endif
 #   endif
 # endif
@@ -1053,21 +1053,21 @@ struct _GC_arrays {
 
   struct HeapSect {
       ptr_t hs_start; size_t hs_bytes;
-  } _heap_sects[MAX_HEAP_SECTS];       /* Heap segments potentially    */
-                                       /* client objects.              */
+  } _heap_sects[MAX_HEAP_SECTS];        /* Heap segments potentially    */
+                                        /* client objects.              */
 # if defined(USE_PROC_FOR_LIBRARIES)
      struct HeapSect _our_memory[MAX_HEAP_SECTS];
-                                       /* All GET_MEM allocated        */
-                                       /* memory.  Includes block      */
-                                       /* headers and the like.        */
+                                        /* All GET_MEM allocated        */
+                                        /* memory.  Includes block      */
+                                        /* headers and the like.        */
 # endif
 # if defined(MSWIN32) || defined(MSWINCE)
     ptr_t _heap_bases[MAX_HEAP_SECTS];
-               /* Start address of memory regions obtained from kernel. */
+                /* Start address of memory regions obtained from kernel. */
 # endif
 # ifdef MSWINCE
     word _heap_lengths[MAX_HEAP_SECTS];
-               /* Committed lengths of memory regions obtained from kernel. */
+                /* Committed lengths of memory regions obtained from kernel. */
 # endif
   struct roots _static_roots[MAX_ROOT_SETS];
 # if !defined(MSWIN32) && !defined(MSWINCE)
@@ -1081,16 +1081,16 @@ struct _GC_arrays {
   ptr_t _trace_addr;
 #endif
 #ifdef SAVE_CALL_CHAIN
-  struct callinfo _last_stack[NFRAMES];        /* Stack at last garbage collection.*/
-                                       /* Useful for debugging mysterious  */
-                                       /* object disappearances.           */
-                                       /* In the multithreaded case, we    */
-                                       /* currently only save the calling  */
-                                       /* stack.                           */
+  struct callinfo _last_stack[NFRAMES]; /* Stack at last garbage collection.*/
+                                        /* Useful for debugging mysterious  */
+                                        /* object disappearances.           */
+                                        /* In the multithreaded case, we    */
+                                        /* currently only save the calling  */
+                                        /* stack.                           */
 #endif
 };
 
-GC_API_PRIV GC_FAR struct _GC_arrays GC_arrays; 
+GC_API_PRIV GC_FAR struct _GC_arrays GC_arrays;
 
 # ifndef SEPARATE_GLOBALS
 #   define GC_objfreelist GC_arrays._objfreelist
@@ -1175,40 +1175,40 @@ GC_API_PRIV GC_FAR struct _GC_arrays GC_arrays;
 # define MAXOBJKINDS 16
 
 extern struct obj_kind {
-   void **ok_freelist; /* Array of free listheaders for this kind of object */
-                       /* Point either to GC_arrays or to storage allocated */
-                       /* with GC_scratch_alloc.                            */
+   void **ok_freelist;  /* Array of free listheaders for this kind of object */
+                        /* Point either to GC_arrays or to storage allocated */
+                        /* with GC_scratch_alloc.                            */
    struct hblk **ok_reclaim_list;
-                       /* List headers for lists of blocks waiting to be */
-                       /* swept.                                         */
-                       /* Indexed by object size in granules.            */
-   word ok_descriptor;  /* Descriptor template for objects in this     */
-                       /* block.                                       */
+                        /* List headers for lists of blocks waiting to be */
+                        /* swept.                                         */
+                        /* Indexed by object size in granules.            */
+   word ok_descriptor;  /* Descriptor template for objects in this      */
+                        /* block.                                       */
    GC_bool ok_relocate_descr;
-                       /* Add object size in bytes to descriptor       */
-                       /* template to obtain descriptor.  Otherwise    */
-                       /* template is used as is.                      */
+                        /* Add object size in bytes to descriptor       */
+                        /* template to obtain descriptor.  Otherwise    */
+                        /* template is used as is.                      */
    GC_bool ok_init;   /* Clear objects before putting them on the free list. */
 } GC_obj_kinds[MAXOBJKINDS];
 
 # define beginGC_obj_kinds ((ptr_t)(&GC_obj_kinds))
 # define endGC_obj_kinds (beginGC_obj_kinds + (sizeof GC_obj_kinds))
 
-/* Variables that used to be in GC_arrays, but need to be accessed by  */
-/* inline allocation code.  If they were in GC_arrays, the inlined     */
-/* allocation code would include GC_arrays offsets (as it did), which  */
-/* introduce maintenance problems.                                     */
+/* Variables that used to be in GC_arrays, but need to be accessed by   */
+/* inline allocation code.  If they were in GC_arrays, the inlined      */
+/* allocation code would include GC_arrays offsets (as it did), which   */
+/* introduce maintenance problems.                                      */
 
 #ifdef SEPARATE_GLOBALS
   word GC_bytes_allocd;
-       /* Number of words allocated during this collection cycle */
+        /* Number of words allocated during this collection cycle */
   ptr_t GC_objfreelist[MAXOBJGRANULES+1];
-                         /* free list for NORMAL objects */
+                          /* free list for NORMAL objects */
 # define beginGC_objfreelist ((ptr_t)(&GC_objfreelist))
 # define endGC_objfreelist (beginGC_objfreelist + sizeof(GC_objfreelist))
 
   ptr_t GC_aobjfreelist[MAXOBJGRANULES+1];
-                         /* free list for atomic (PTRFREE) objs        */
+                          /* free list for atomic (PTRFREE) objs        */
 # define beginGC_aobjfreelist ((ptr_t)(&GC_aobjfreelist))
 # define endGC_aobjfreelist (beginGC_aobjfreelist + sizeof(GC_aobjfreelist))
 #endif
@@ -1230,12 +1230,12 @@ extern unsigned GC_n_kinds;
 
 extern word GC_fo_entries;
 
-extern word GC_n_heap_sects;   /* Number of separately added heap      */
-                               /* sections.                            */
+extern word GC_n_heap_sects;    /* Number of separately added heap      */
+                                /* sections.                            */
 
 #ifdef USE_PROC_FOR_LIBRARIES
-  extern word GC_n_memory;     /* Number of GET_MEM allocated memory   */
-                               /* sections.                            */
+  extern word GC_n_memory;      /* Number of GET_MEM allocated memory   */
+                                /* sections.                            */
 #endif
 
 extern word GC_page_size;
@@ -1246,52 +1246,52 @@ extern word GC_page_size;
 # endif
 
 extern word GC_total_stack_black_listed;
-                       /* Number of bytes on stack blacklist.  */
+                        /* Number of bytes on stack blacklist.  */
 
 extern word GC_black_list_spacing;
-                       /* Average number of bytes between blacklisted  */
-                       /* blocks. Approximate.                         */
-                       /* Counts only blocks that are                  */
-                       /* "stack-blacklisted", i.e. that are           */
-                       /* problematic in the interior of an object.    */
+                        /* Average number of bytes between blacklisted  */
+                        /* blocks. Approximate.                         */
+                        /* Counts only blocks that are                  */
+                        /* "stack-blacklisted", i.e. that are           */
+                        /* problematic in the interior of an object.    */
 
 extern struct hblk * GC_hblkfreelist[];
-                               /* List of completely empty heap blocks */
-                               /* Linked through hb_next field of      */
-                               /* header structure associated with     */
-                               /* block.                               */
+                                /* List of completely empty heap blocks */
+                                /* Linked through hb_next field of      */
+                                /* header structure associated with     */
+                                /* block.                               */
 
-extern GC_bool GC_objects_are_marked;  /* There are marked objects in  */
-                                       /* the heap.                    */
+extern GC_bool GC_objects_are_marked;   /* There are marked objects in  */
+                                        /* the heap.                    */
 
 #ifndef SMALL_CONFIG
   extern GC_bool GC_incremental;
-                       /* Using incremental/generational collection. */
+                        /* Using incremental/generational collection. */
 # define TRUE_INCREMENTAL \
-       (GC_incremental && GC_time_limit != GC_TIME_UNLIMITED)
-       /* True incremental, not just generational, mode */
+        (GC_incremental && GC_time_limit != GC_TIME_UNLIMITED)
+        /* True incremental, not just generational, mode */
 #else
 # define GC_incremental FALSE
-                       /* Hopefully allow optimizer to remove some code. */
+                        /* Hopefully allow optimizer to remove some code. */
 # define TRUE_INCREMENTAL FALSE
 #endif
 
 extern GC_bool GC_dirty_maintained;
-                               /* Dirty bits are being maintained,     */
-                               /* either for incremental collection,   */
-                               /* or to limit the root set.            */
+                                /* Dirty bits are being maintained,     */
+                                /* either for incremental collection,   */
+                                /* or to limit the root set.            */
 
-extern word GC_root_size;      /* Total size of registered root sections */
+extern word GC_root_size;       /* Total size of registered root sections */
 
-extern GC_bool GC_debugging_started;   /* GC_debug_malloc has been called. */ 
+extern GC_bool GC_debugging_started;    /* GC_debug_malloc has been called. */
 
 extern long GC_large_alloc_warn_interval;
-       /* Interval between unsuppressed warnings.      */
+        /* Interval between unsuppressed warnings.      */
 
 extern long GC_large_alloc_warn_suppressed;
-       /* Number of warnings suppressed so far.        */
+        /* Number of warnings suppressed so far.        */
 
-/* This is used by GC_do_blocking[_inner]().           */
+/* This is used by GC_do_blocking[_inner]().            */
 struct blocking_data {
     GC_fn_type fn;
     void * client_data; /* and result */
@@ -1308,24 +1308,24 @@ struct GC_activation_frame_s {
 };
 
 #ifdef THREADS
-/* Process all activation "frames" - scan entire stack except for      */
-/* frames belonging to the user functions invoked by GC_do_blocking(). */
+/* Process all activation "frames" - scan entire stack except for       */
+/* frames belonging to the user functions invoked by GC_do_blocking().  */
 void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
-                       struct GC_activation_frame_s *activation_frame);
+                        struct GC_activation_frame_s *activation_frame);
 
   extern GC_bool GC_world_stopped;
 #else
   extern ptr_t GC_blocked_sp;
   extern struct GC_activation_frame_s *GC_activation_frame;
-                       /* Points to the "frame" data held in stack by  */
-                       /* the innermost GC_call_with_gc_active().      */
-                       /* NULL if no such "frame" active.              */
+                        /* Points to the "frame" data held in stack by  */
+                        /* the innermost GC_call_with_gc_active().      */
+                        /* NULL if no such "frame" active.              */
 #endif /* !THREADS */
 
 #ifdef IA64
   /* Similar to GC_push_all_stack_frames() but for IA-64 registers store. */
   void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi, int eager,
-                       struct GC_activation_frame_s *activation_frame);
+                        struct GC_activation_frame_s *activation_frame);
 #endif
 
 /*  Marks are in a reserved area in                          */
@@ -1333,11 +1333,11 @@ void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
 /*  with it. Only those corresponding to the beginning of an */
 /*  object are used.                                         */
 
-/* Set mark bit correctly, even if mark bits may be concurrently       */
-/* accessed.                                                           */
+/* Set mark bit correctly, even if mark bits may be concurrently        */
+/* accessed.                                                            */
 #ifdef PARALLEL_MARK
 # define OR_WORD(addr, bits) \
-       { AO_or((volatile AO_t *)(addr), (AO_t)bits); }
+        { AO_or((volatile AO_t *)(addr), (AO_t)bits); }
 #else
 # define OR_WORD(addr, bits) *(addr) |= (bits)
 #endif
@@ -1357,357 +1357,357 @@ void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
 # define clear_mark_bit_from_hdr(hhdr,n) ((hhdr)->hb_marks[n]) = 0
 #else /* !USE_MARK_BYTES */
 # define mark_bit_from_hdr(hhdr,n) (((hhdr)->hb_marks[divWORDSZ(n)] \
-                           >> (modWORDSZ(n))) & (word)1)
+                            >> (modWORDSZ(n))) & (word)1)
 # define set_mark_bit_from_hdr(hhdr,n) \
-                           OR_WORD((hhdr)->hb_marks+divWORDSZ(n), \
-                                   (word)1 << modWORDSZ(n))
+                            OR_WORD((hhdr)->hb_marks+divWORDSZ(n), \
+                                    (word)1 << modWORDSZ(n))
 # define clear_mark_bit_from_hdr(hhdr,n) (hhdr)->hb_marks[divWORDSZ(n)] \
-                               &= ~((word)1 << modWORDSZ(n))
+                                &= ~((word)1 << modWORDSZ(n))
 #endif /* !USE_MARK_BYTES */
 
 #ifdef MARK_BIT_PER_OBJ
 #  define MARK_BIT_NO(offset, sz) (((unsigned)(offset))/(sz))
-       /* Get the mark bit index corresponding to the given byte       */
-       /* offset and size (in bytes).                                  */
+        /* Get the mark bit index corresponding to the given byte       */
+        /* offset and size (in bytes).                                  */
 #  define MARK_BIT_OFFSET(sz) 1
-       /* Spacing between useful mark bits.                            */
+        /* Spacing between useful mark bits.                            */
 #  define IF_PER_OBJ(x) x
 #  define FINAL_MARK_BIT(sz) ((sz) > MAXOBJBYTES? 1 : HBLK_OBJS(sz))
-       /* Position of final, always set, mark bit.                     */
+        /* Position of final, always set, mark bit.                     */
 #else /* MARK_BIT_PER_GRANULE */
 #  define MARK_BIT_NO(offset, sz) BYTES_TO_GRANULES((unsigned)(offset))
 #  define MARK_BIT_OFFSET(sz) BYTES_TO_GRANULES(sz)
 #  define IF_PER_OBJ(x)
 #  define FINAL_MARK_BIT(sz) \
-       ((sz) > MAXOBJBYTES? MARK_BITS_PER_HBLK \
-                       : BYTES_TO_GRANULES(sz * HBLK_OBJS(sz)))
+        ((sz) > MAXOBJBYTES? MARK_BITS_PER_HBLK \
+                        : BYTES_TO_GRANULES(sz * HBLK_OBJS(sz)))
 #endif
 
 /* Important internal collector routines */
 
 ptr_t GC_approx_sp(void);
-  
+
 GC_bool GC_should_collect(void);
-  
+
 void GC_apply_to_all_blocks(void (*fn) (struct hblk *h, word client_data),
-                           word client_data);
-                       /* Invoke fn(hbp, client_data) for each         */
-                       /* allocated heap block.                        */
+                            word client_data);
+                        /* Invoke fn(hbp, client_data) for each         */
+                        /* allocated heap block.                        */
 struct hblk * GC_next_used_block(struct hblk * h);
-                       /* Return first in-use block >= h       */
+                        /* Return first in-use block >= h       */
 struct hblk * GC_prev_block(struct hblk * h);
-                       /* Return last block <= h.  Returned block      */
-                       /* is managed by GC, but may or may not be in   */
-                       /* use.                                         */
+                        /* Return last block <= h.  Returned block      */
+                        /* is managed by GC, but may or may not be in   */
+                        /* use.                                         */
 void GC_mark_init(void);
-void GC_clear_marks(void);     /* Clear mark bits for all heap objects. */
+void GC_clear_marks(void);      /* Clear mark bits for all heap objects. */
 void GC_invalidate_mark_state(void);
-                                       /* Tell the marker that marked     */
-                                       /* objects may point to unmarked   */
-                                       /* ones, and roots may point to    */
-                                       /* unmarked objects.               */
-                                       /* Reset mark stack.               */
+                                        /* Tell the marker that marked     */
+                                        /* objects may point to unmarked   */
+                                        /* ones, and roots may point to    */
+                                        /* unmarked objects.               */
+                                        /* Reset mark stack.               */
 GC_bool GC_mark_stack_empty(void);
 GC_bool GC_mark_some(ptr_t cold_gc_frame);
-                       /* Perform about one pages worth of marking     */
-                       /* work of whatever kind is needed.  Returns    */
-                       /* quickly if no collection is in progress.     */
-                       /* Return TRUE if mark phase finished.          */
+                        /* Perform about one pages worth of marking     */
+                        /* work of whatever kind is needed.  Returns    */
+                        /* quickly if no collection is in progress.     */
+                        /* Return TRUE if mark phase finished.          */
 void GC_initiate_gc(void);
-                               /* initiate collection.                 */
-                               /* If the mark state is invalid, this   */
-                               /* becomes full collection.  Otherwise  */
-                               /* it's partial.                        */
+                                /* initiate collection.                 */
+                                /* If the mark state is invalid, this   */
+                                /* becomes full collection.  Otherwise  */
+                                /* it's partial.                        */
 void GC_push_all(ptr_t bottom, ptr_t top);
-                               /* Push everything in a range           */
-                               /* onto mark stack.                     */
+                                /* Push everything in a range           */
+                                /* onto mark stack.                     */
 void GC_push_selected(ptr_t bottom, ptr_t top,
-                     int (*dirty_fn) (struct hblk *h),
-                     void (*push_fn) (ptr_t bottom, ptr_t top) );
-                                 /* Push all pages h in [b,t) s.t.     */
-                                 /* select_fn(h) != 0 onto mark stack. */
+                      int (*dirty_fn) (struct hblk *h),
+                      void (*push_fn) (ptr_t bottom, ptr_t top) );
+                                  /* Push all pages h in [b,t) s.t.     */
+                                  /* select_fn(h) != 0 onto mark stack. */
 #ifndef SMALL_CONFIG
   void GC_push_conditional (ptr_t b, ptr_t t, GC_bool all);
 #else
 # define GC_push_conditional(b, t, all) GC_push_all(b, t)
 #endif
-                                /* Do either of the above, depending   */
-                               /* on the third arg.                    */
+                                /* Do either of the above, depending    */
+                                /* on the third arg.                    */
 void GC_push_all_stack (ptr_t b, ptr_t t);
-                                   /* As above, but consider           */
-                                   /*  interior pointers as valid      */
+                                    /* As above, but consider           */
+                                    /*  interior pointers as valid      */
 void GC_push_all_eager (ptr_t b, ptr_t t);
-                                   /* Same as GC_push_all_stack, but   */
-                                   /* ensures that stack is scanned    */
-                                   /* immediately, not just scheduled  */
-                                   /* for scanning.                    */
+                                    /* Same as GC_push_all_stack, but   */
+                                    /* ensures that stack is scanned    */
+                                    /* immediately, not just scheduled  */
+                                    /* for scanning.                    */
 
-  /* In the threads case, we push part of the current thread stack     */
+  /* In the threads case, we push part of the current thread stack      */
   /* with GC_push_all_eager when we push the registers.  This gets the  */
-  /* callee-save registers that may disappear.  The remainder of the   */
-  /* stacks are scheduled for scanning in *GC_push_other_roots, which  */
-  /* is thread-package-specific.                                       */
+  /* callee-save registers that may disappear.  The remainder of the    */
+  /* stacks are scheduled for scanning in *GC_push_other_roots, which   */
+  /* is thread-package-specific.                                        */
 
 void GC_push_roots(GC_bool all, ptr_t cold_gc_frame);
-                       /* Push all or dirty roots.     */
+                        /* Push all or dirty roots.     */
 extern void (*GC_push_other_roots)(void);
-                       /* Push system or application specific roots    */
-                       /* onto the mark stack.  In some environments   */
-                       /* (e.g. threads environments) this is          */
-                       /* predefined to be non-zero.  A client         */
-                       /* supplied replacement should also call the    */
-                       /* original function.                           */
-
-       extern void GC_push_finalizer_structures(void);
-       extern void GC_push_stubborn_structures (void);
-#      ifdef THREADS
-         extern void GC_push_thread_structures (void);
-#      endif
-       extern void (*GC_push_typed_structures) (void);
-                       /* A pointer such that we can avoid linking in  */
-                       /* the typed allocation support if unused.      */
+                        /* Push system or application specific roots    */
+                        /* onto the mark stack.  In some environments   */
+                        /* (e.g. threads environments) this is          */
+                        /* predefined to be non-zero.  A client         */
+                        /* supplied replacement should also call the    */
+                        /* original function.                           */
+
+        extern void GC_push_finalizer_structures(void);
+        extern void GC_push_stubborn_structures (void);
+#       ifdef THREADS
+          extern void GC_push_thread_structures (void);
+#       endif
+        extern void (*GC_push_typed_structures) (void);
+                        /* A pointer such that we can avoid linking in  */
+                        /* the typed allocation support if unused.      */
 extern void (*GC_start_call_back) (void);
-                       /* Called at start of full collections.         */
-                       /* Not called if 0.  Called with allocation     */
-                       /* lock held.                                   */
-                       /* 0 by default.                                */
+                        /* Called at start of full collections.         */
+                        /* Not called if 0.  Called with allocation     */
+                        /* lock held.                                   */
+                        /* 0 by default.                                */
 
 void GC_push_regs(void);
 
 void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
-                                ptr_t arg);
+                                 ptr_t arg);
 
 # if defined(SPARC) || defined(IA64)
-  /* Cause all stacked registers to be saved in memory.  Return a      */
-  /* pointer to the top of the corresponding memory stack.             */
+  /* Cause all stacked registers to be saved in memory.  Return a       */
+  /* pointer to the top of the corresponding memory stack.              */
   ptr_t GC_save_regs_in_stack(void);
 # endif
-                       /* Push register contents onto mark stack.      */
+                        /* Push register contents onto mark stack.      */
 
 # if defined(MSWIN32) || defined(MSWINCE)
   void __cdecl GC_push_one(word p);
 # else
   void GC_push_one(word p);
-                             /* If p points to an object, mark it    */
+                              /* If p points to an object, mark it    */
                               /* and push contents on the mark stack  */
-                             /* Pointer recognition test always      */
-                             /* accepts interior pointers, i.e. this */
-                             /* is appropriate for pointers found on */
-                             /* stack.                               */
+                              /* Pointer recognition test always      */
+                              /* accepts interior pointers, i.e. this */
+                              /* is appropriate for pointers found on */
+                              /* stack.                               */
 # endif
 # if defined(PRINT_BLACK_LIST) || defined(KEEP_BACK_PTRS)
   void GC_mark_and_push_stack(ptr_t p, ptr_t source);
-                               /* Ditto, omits plausibility test       */
+                                /* Ditto, omits plausibility test       */
 # else
   void GC_mark_and_push_stack(ptr_t p);
 # endif
 void GC_push_marked(struct hblk * h, hdr * hhdr);
-               /* Push contents of all marked objects in h onto        */
-               /* mark stack.                                          */
+                /* Push contents of all marked objects in h onto        */
+                /* mark stack.                                          */
 #ifdef SMALL_CONFIG
 # define GC_push_next_marked_dirty(h) GC_push_next_marked(h)
 #else
   struct hblk * GC_push_next_marked_dirty(struct hblk * h);
-               /* Invoke GC_push_marked on next dirty block above h.   */
-               /* Return a pointer just past the end of this block.    */
+                /* Invoke GC_push_marked on next dirty block above h.   */
+                /* Return a pointer just past the end of this block.    */
 #endif /* !SMALL_CONFIG */
 struct hblk * GC_push_next_marked(struct hblk * h);
-               /* Ditto, but also mark from clean pages.       */
+                /* Ditto, but also mark from clean pages.       */
 struct hblk * GC_push_next_marked_uncollectable(struct hblk * h);
-               /* Ditto, but mark only from uncollectable pages.       */
+                /* Ditto, but mark only from uncollectable pages.       */
 void GC_clear_hdr_marks(hdr * hhdr);
-                                   /* Clear the mark bits in a header */
+                                    /* Clear the mark bits in a header */
 void GC_set_hdr_marks(hdr * hhdr);
-                                   /* Set the mark bits in a header */
+                                    /* Set the mark bits in a header */
 void GC_set_fl_marks(ptr_t p);
-                                   /* Set all mark bits associated with */
-                                   /* a free list.                      */
+                                    /* Set all mark bits associated with */
+                                    /* a free list.                      */
 #ifdef GC_ASSERTIONS
   void GC_check_fl_marks(ptr_t p);
-                                   /* Check that  all mark bits        */
-                                   /* associated with a free list are  */
-                                   /* set.  Abort if not.              */
+                                    /* Check that  all mark bits        */
+                                    /* associated with a free list are  */
+                                    /* set.  Abort if not.              */
 #endif
 void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp);
 void GC_exclude_static_roots_inner(void *start, void *finish);
 GC_bool GC_is_static_root(ptr_t p);
-               /* Is the address p in one of the registered static     */
-               /* root sections?                                       */
+                /* Is the address p in one of the registered static     */
+                /* root sections?                                       */
 # if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION)
 GC_bool GC_is_tmp_root(ptr_t p);
-               /* Is the address p in one of the temporary static      */
-               /* root sections?                                       */
+                /* Is the address p in one of the temporary static      */
+                /* root sections?                                       */
 # endif
 void GC_register_dynamic_libraries(void);
-               /* Add dynamic library data sections to the root set. */
+                /* Add dynamic library data sections to the root set. */
 void GC_cond_register_dynamic_libraries(void);
-               /* Remove and reregister dynamic libraries if we're     */
-               /* configured to do that at each GC.                    */
+                /* Remove and reregister dynamic libraries if we're     */
+                /* configured to do that at each GC.                    */
 
 GC_bool GC_register_main_static_data(void);
-               /* We need to register the main data segment.  Returns  */
-               /* TRUE unless this is done implicitly as part of       */
-               /* dynamic library registration.                        */
-  
+                /* We need to register the main data segment.  Returns  */
+                /* TRUE unless this is done implicitly as part of       */
+                /* dynamic library registration.                        */
+
 /* Machine dependent startup routines */
-ptr_t GC_get_main_stack_base(void);    /* Cold end of stack */
+ptr_t GC_get_main_stack_base(void);     /* Cold end of stack */
 #ifdef IA64
   ptr_t GC_get_register_stack_base(void);
-                                       /* Cold end of register stack.  */
+                                        /* Cold end of register stack.  */
 #endif
 void GC_register_data_segments(void);
-  
+
 /* Black listing: */
 void GC_bl_init(void);
 # ifdef PRINT_BLACK_LIST
       void GC_add_to_black_list_normal(word p, ptr_t source);
-                       /* Register bits as a possible future false     */
-                       /* reference from the heap or static data       */
+                        /* Register bits as a possible future false     */
+                        /* reference from the heap or static data       */
 #     define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source) \
-               if (GC_all_interior_pointers) { \
-                 GC_add_to_black_list_stack((word)(bits), (source)); \
-               } else { \
-                 GC_add_to_black_list_normal((word)(bits), (source)); \
-               }
+                if (GC_all_interior_pointers) { \
+                  GC_add_to_black_list_stack((word)(bits), (source)); \
+                } else { \
+                  GC_add_to_black_list_normal((word)(bits), (source)); \
+                }
 # else
       void GC_add_to_black_list_normal(word p);
 #     define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source) \
-               if (GC_all_interior_pointers) { \
-                 GC_add_to_black_list_stack((word)(bits)); \
-               } else { \
-                 GC_add_to_black_list_normal((word)(bits)); \
-               }
+                if (GC_all_interior_pointers) { \
+                  GC_add_to_black_list_stack((word)(bits)); \
+                } else { \
+                  GC_add_to_black_list_normal((word)(bits)); \
+                }
 # endif
 
 # ifdef PRINT_BLACK_LIST
     void GC_add_to_black_list_stack(word p, ptr_t source);
 #   define GC_ADD_TO_BLACK_LIST_STACK(bits, source) \
-           GC_add_to_black_list_stack((word)(bits), (source))
+            GC_add_to_black_list_stack((word)(bits), (source))
 # else
     void GC_add_to_black_list_stack(word p);
 #   define GC_ADD_TO_BLACK_LIST_STACK(bits, source) \
-           GC_add_to_black_list_stack((word)(bits))
+            GC_add_to_black_list_stack((word)(bits))
 # endif
 struct hblk * GC_is_black_listed(struct hblk * h, word len);
-                       /* If there are likely to be false references   */
-                       /* to a block starting at h of the indicated    */
-                       /* length, then return the next plausible       */
-                       /* starting location for h that might avoid     */
-                       /* these false references.                      */
+                        /* If there are likely to be false references   */
+                        /* to a block starting at h of the indicated    */
+                        /* length, then return the next plausible       */
+                        /* starting location for h that might avoid     */
+                        /* these false references.                      */
 void GC_promote_black_lists(void);
-                       /* Declare an end to a black listing phase.     */
+                        /* Declare an end to a black listing phase.     */
 void GC_unpromote_black_lists(void);
-                       /* Approximately undo the effect of the above.  */
-                       /* This actually loses some information, but    */
-                       /* only in a reasonably safe way.               */
+                        /* Approximately undo the effect of the above.  */
+                        /* This actually loses some information, but    */
+                        /* only in a reasonably safe way.               */
 word GC_number_stack_black_listed(struct hblk *start, struct hblk *endp1);
-                       /* Return the number of (stack) blacklisted     */
-                       /* blocks in the range for statistical          */
-                       /* purposes.                                    */
-                       
+                        /* Return the number of (stack) blacklisted     */
+                        /* blocks in the range for statistical          */
+                        /* purposes.                                    */
+
 ptr_t GC_scratch_alloc(size_t bytes);
-                               /* GC internal memory allocation for    */
-                               /* small objects.  Deallocation is not  */
-                               /* possible.                            */
-       
-/* Heap block layout maps: */                  
+                                /* GC internal memory allocation for    */
+                                /* small objects.  Deallocation is not  */
+                                /* possible.                            */
+
+/* Heap block layout maps: */
 GC_bool GC_add_map_entry(size_t sz);
-                               /* Add a heap block map for objects of  */
-                               /* size sz to obj_map.                  */
-                               /* Return FALSE on failure.             */
+                                /* Add a heap block map for objects of  */
+                                /* size sz to obj_map.                  */
+                                /* Return FALSE on failure.             */
 void GC_register_displacement_inner(size_t offset);
-                               /* Version of GC_register_displacement  */
-                               /* that assumes lock is already held.   */
+                                /* Version of GC_register_displacement  */
+                                /* that assumes lock is already held.   */
 
 void GC_initialize_offsets(void);
-                               /* Initialize GC_valid_offsets,         */
-                               /* depending on current                 */
-                               /* GC_all_interior_pointers settings.   */
-  
-/*  hblk allocation: */                
+                                /* Initialize GC_valid_offsets,         */
+                                /* depending on current                 */
+                                /* GC_all_interior_pointers settings.   */
+
+/*  hblk allocation: */
 void GC_new_hblk(size_t size_in_granules, int kind);
-                               /* Allocate a new heap block, and build */
-                               /* a free list in it.                   */                              
+                                /* Allocate a new heap block, and build */
+                                /* a free list in it.                   */
 
 ptr_t GC_build_fl(struct hblk *h, size_t words, GC_bool clear, ptr_t list);
-                               /* Build a free list for objects of     */
-                               /* size sz in block h.  Append list to  */
-                               /* end of the free lists.  Possibly     */
-                               /* clear objects on the list.  Normally */
-                               /* called by GC_new_hblk, but also      */
-                               /* called explicitly without GC lock.   */
+                                /* Build a free list for objects of     */
+                                /* size sz in block h.  Append list to  */
+                                /* end of the free lists.  Possibly     */
+                                /* clear objects on the list.  Normally */
+                                /* called by GC_new_hblk, but also      */
+                                /* called explicitly without GC lock.   */
 
 struct hblk * GC_allochblk (size_t size_in_bytes, int kind,
-                           unsigned flags);
-                               /* Allocate a heap block, inform        */
-                               /* the marker that block is valid       */
-                               /* for objects of indicated size.       */
+                            unsigned flags);
+                                /* Allocate a heap block, inform        */
+                                /* the marker that block is valid       */
+                                /* for objects of indicated size.       */
 
 ptr_t GC_alloc_large (size_t lb, int k, unsigned flags);
-                       /* Allocate a large block of size lb bytes.     */
-                       /* The block is not cleared.                    */
-                       /* Flags is 0 or IGNORE_OFF_PAGE.               */
-                       /* Calls GC_allchblk to do the actual           */
-                       /* allocation, but also triggers GC and/or      */
-                       /* heap expansion as appropriate.               */
-                       /* Does not update GC_bytes_allocd, but does    */
-                       /* other accounting.                            */
+                        /* Allocate a large block of size lb bytes.     */
+                        /* The block is not cleared.                    */
+                        /* Flags is 0 or IGNORE_OFF_PAGE.               */
+                        /* Calls GC_allchblk to do the actual           */
+                        /* allocation, but also triggers GC and/or      */
+                        /* heap expansion as appropriate.               */
+                        /* Does not update GC_bytes_allocd, but does    */
+                        /* other accounting.                            */
 
 ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags);
-                       /* As above, but clear block if appropriate     */
-                       /* for kind k.                                  */
+                        /* As above, but clear block if appropriate     */
+                        /* for kind k.                                  */
 
 void GC_freehblk(struct hblk * p);
-                               /* Deallocate a heap block and mark it  */
-                               /* as invalid.                          */
-                               
+                                /* Deallocate a heap block and mark it  */
+                                /* as invalid.                          */
+
 /*  Misc GC: */
 GC_bool GC_expand_hp_inner(word n);
 void GC_start_reclaim(int abort_if_found);
-                               /* Restore unmarked objects to free     */
-                               /* lists, or (if abort_if_found is      */
-                               /* TRUE) report them.                   */
-                               /* Sweeping of small object pages is    */
-                               /* largely deferred.                    */
+                                /* Restore unmarked objects to free     */
+                                /* lists, or (if abort_if_found is      */
+                                /* TRUE) report them.                   */
+                                /* Sweeping of small object pages is    */
+                                /* largely deferred.                    */
 void GC_continue_reclaim(size_t sz, int kind);
-                               /* Sweep pages of the given size and    */
-                               /* kind, as long as possible, and       */
-                               /* as long as the corr. free list is    */
-                               /* empty.  Sz is in granules.           */
+                                /* Sweep pages of the given size and    */
+                                /* kind, as long as possible, and       */
+                                /* as long as the corr. free list is    */
+                                /* empty.  Sz is in granules.           */
 void GC_reclaim_or_delete_all(void);
-                               /* Arrange for all reclaim lists to be  */
-                               /* empty.  Judiciously choose between   */
-                               /* sweeping and discarding each page.   */
+                                /* Arrange for all reclaim lists to be  */
+                                /* empty.  Judiciously choose between   */
+                                /* sweeping and discarding each page.   */
 GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old);
-                               /* Reclaim all blocks.  Abort (in a     */
-                               /* consistent state) if f returns TRUE. */
+                                /* Reclaim all blocks.  Abort (in a     */
+                                /* consistent state) if f returns TRUE. */
 ptr_t GC_reclaim_generic(struct hblk * hbp, hdr *hhdr, size_t sz,
-                        GC_bool init, ptr_t list, signed_word *count);
-                               /* Rebuild free list in hbp with        */
-                               /* header hhdr, with objects of size sz */
-                               /* bytes.  Add list to the end of the   */
-                               /* free list.  Add the number of        */
-                               /* reclaimed bytes to *count.           */
+                         GC_bool init, ptr_t list, signed_word *count);
+                                /* Rebuild free list in hbp with        */
+                                /* header hhdr, with objects of size sz */
+                                /* bytes.  Add list to the end of the   */
+                                /* free list.  Add the number of        */
+                                /* reclaimed bytes to *count.           */
 GC_bool GC_block_empty(hdr * hhdr);
-                               /* Block completely unmarked?   */
+                                /* Block completely unmarked?   */
 GC_bool GC_CALLBACK GC_never_stop_func(void);
-                               /* Returns FALSE.               */
+                                /* Returns FALSE.               */
 GC_bool GC_try_to_collect_inner(GC_stop_func f);
 
-                               /* Collect; caller must have acquired   */
-                               /* lock.  Collection is aborted if f    */
-                               /* returns TRUE.  Returns TRUE if it    */
-                               /* completes successfully.              */
+                                /* Collect; caller must have acquired   */
+                                /* lock.  Collection is aborted if f    */
+                                /* returns TRUE.  Returns TRUE if it    */
+                                /* completes successfully.              */
 # define GC_gcollect_inner() \
-       (void) GC_try_to_collect_inner(GC_never_stop_func)
+        (void) GC_try_to_collect_inner(GC_never_stop_func)
 GC_bool GC_collect_or_expand(word needed_blocks, GC_bool ignore_off_page);
-                               /* Collect or expand heap in an attempt */
-                               /* make the indicated number of free    */
-                               /* blocks available.  Should be called  */
-                               /* until the blocks are available or    */
-                               /* until it fails by returning FALSE.   */
+                                /* Collect or expand heap in an attempt */
+                                /* make the indicated number of free    */
+                                /* blocks available.  Should be called  */
+                                /* until the blocks are available or    */
+                                /* until it fails by returning FALSE.   */
 
-extern GC_bool GC_is_initialized;      /* GC_init() has been run.      */
+extern GC_bool GC_is_initialized;       /* GC_init() has been run.      */
 
 #if defined(MSWIN32) || defined(MSWINCE)
   void GC_deinit(void);
@@ -1716,137 +1716,137 @@ extern GC_bool GC_is_initialized;     /* GC_init() has been run.      */
 #endif
 
 void GC_collect_a_little_inner(int n);
-                               /* Do n units worth of garbage          */
-                               /* collection work, if appropriate.     */
-                               /* A unit is an amount appropriate for  */
-                               /* HBLKSIZE bytes of allocation.        */
+                                /* Do n units worth of garbage          */
+                                /* collection work, if appropriate.     */
+                                /* A unit is an amount appropriate for  */
+                                /* HBLKSIZE bytes of allocation.        */
 /* void * GC_generic_malloc(size_t lb, int k); */
-                               /* Allocate an object of the given      */
-                               /* kind.  By default, there are only    */
-                               /* a few kinds: composite(pointerfree), */
-                               /* atomic, uncollectable, etc.          */
-                               /* We claim it's possible for clever    */
-                               /* client code that understands GC      */
-                               /* internals to add more, e.g. to       */
-                               /* communicate object layout info       */
-                               /* to the collector.                    */
-                               /* The actual decl is in gc_mark.h.     */
+                                /* Allocate an object of the given      */
+                                /* kind.  By default, there are only    */
+                                /* a few kinds: composite(pointerfree), */
+                                /* atomic, uncollectable, etc.          */
+                                /* We claim it's possible for clever    */
+                                /* client code that understands GC      */
+                                /* internals to add more, e.g. to       */
+                                /* communicate object layout info       */
+                                /* to the collector.                    */
+                                /* The actual decl is in gc_mark.h.     */
 void * GC_generic_malloc_ignore_off_page(size_t b, int k);
-                               /* As above, but pointers past the      */
-                               /* first page of the resulting object   */
-                               /* are ignored.                         */
+                                /* As above, but pointers past the      */
+                                /* first page of the resulting object   */
+                                /* are ignored.                         */
 void * GC_generic_malloc_inner(size_t lb, int k);
-                               /* Ditto, but I already hold lock, etc. */
+                                /* Ditto, but I already hold lock, etc. */
 void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k);
-                               /* Allocate an object, where            */
-                               /* the client guarantees that there     */
-                               /* will always be a pointer to the      */
-                               /* beginning of the object while the    */
-                               /* object is live.                      */
+                                /* Allocate an object, where            */
+                                /* the client guarantees that there     */
+                                /* will always be a pointer to the      */
+                                /* beginning of the object while the    */
+                                /* object is live.                      */
 void GC_generic_malloc_many(size_t lb, int k, void **result);
-                               /* Store a pointer to a list of newly   */
-                               /* allocated objects of kind k and size */
-                               /* lb in *result.                       */
-                               /* Caler must make sure that *result is */
-                               /* traced even if objects are ptrfree.  */
+                                /* Store a pointer to a list of newly   */
+                                /* allocated objects of kind k and size */
+                                /* lb in *result.                       */
+                                /* Caler must make sure that *result is */
+                                /* traced even if objects are ptrfree.  */
 ptr_t GC_allocobj(size_t sz, int kind);
-                               /* Make the indicated                   */
-                               /* free list nonempty, and return its   */
-                               /* head.  Sz is in granules.            */
+                                /* Make the indicated                   */
+                                /* free list nonempty, and return its   */
+                                /* head.  Sz is in granules.            */
 
-/* Allocation routines that bypass the thread local cache.     */
-/* Used internally.                                            */
+/* Allocation routines that bypass the thread local cache.      */
+/* Used internally.                                             */
 #ifdef THREAD_LOCAL_ALLOC
   void * GC_core_malloc(size_t);
   void * GC_core_malloc_atomic(size_t);
 # ifdef GC_GCJ_SUPPORT
-    void *GC_core_gcj_malloc(size_t, void *); 
+    void *GC_core_gcj_malloc(size_t, void *);
 # endif
 #endif /* THREAD_LOCAL_ALLOC */
 
 void GC_free_inner(void * p);
 void GC_debug_free_inner(void * p);
-  
+
 void GC_init_headers(void);
 struct hblkhdr * GC_install_header(struct hblk *h);
-                               /* Install a header for block h.        */
-                               /* Return 0 on failure, or the header   */
-                               /* otherwise.                           */
+                                /* Install a header for block h.        */
+                                /* Return 0 on failure, or the header   */
+                                /* otherwise.                           */
 GC_bool GC_install_counts(struct hblk * h, size_t sz);
-                               /* Set up forwarding counts for block   */
-                               /* h of size sz.                        */
-                               /* Return FALSE on failure.             */
+                                /* Set up forwarding counts for block   */
+                                /* h of size sz.                        */
+                                /* Return FALSE on failure.             */
 void GC_remove_header(struct hblk * h);
-                               /* Remove the header for block h.       */
+                                /* Remove the header for block h.       */
 void GC_remove_counts(struct hblk * h, size_t sz);
-                               /* Remove forwarding counts for h.      */
-hdr * GC_find_header(ptr_t h); /* Debugging only.              */
-  
+                                /* Remove forwarding counts for h.      */
+hdr * GC_find_header(ptr_t h); /* Debugging only.               */
+
 void GC_finalize(void);
-                       /* Perform all indicated finalization actions   */
-                       /* on unmarked objects.                         */
-                       /* Unreachable finalizable objects are enqueued */
-                       /* for processing by GC_invoke_finalizers.      */
-                       /* Invoked with lock.                           */
+                        /* Perform all indicated finalization actions   */
+                        /* on unmarked objects.                         */
+                        /* Unreachable finalizable objects are enqueued */
+                        /* for processing by GC_invoke_finalizers.      */
+                        /* Invoked with lock.                           */
 
 void GC_notify_or_invoke_finalizers(void);
-                       /* If GC_finalize_on_demand is not set, invoke  */
-                       /* eligible finalizers. Otherwise:              */
-                       /* Call *GC_finalizer_notifier if there are     */
-                       /* finalizers to be run, and we haven't called  */
-                       /* this procedure yet this GC cycle.            */
+                        /* If GC_finalize_on_demand is not set, invoke  */
+                        /* eligible finalizers. Otherwise:              */
+                        /* Call *GC_finalizer_notifier if there are     */
+                        /* finalizers to be run, and we haven't called  */
+                        /* this procedure yet this GC cycle.            */
 
 void * GC_make_closure(GC_finalization_proc fn, void * data);
 void GC_CALLBACK GC_debug_invoke_finalizer(void * obj, void * data);
-                       /* Auxiliary fns to make finalization work      */
-                       /* correctly with displaced pointers introduced */
-                       /* by the debugging allocators.                 */
-                       
+                        /* Auxiliary fns to make finalization work      */
+                        /* correctly with displaced pointers introduced */
+                        /* by the debugging allocators.                 */
+
 void GC_add_to_heap(struct hblk *p, size_t bytes);
-                       /* Add a HBLKSIZE aligned chunk to the heap.    */
+                        /* Add a HBLKSIZE aligned chunk to the heap.    */
 
 #ifdef USE_PROC_FOR_LIBRARIES
   void GC_add_to_our_memory(ptr_t p, size_t bytes);
-                       /* Add a chunk to GC_our_memory.        */
-                       /* If p == 0, do nothing.               */
+                        /* Add a chunk to GC_our_memory.        */
+                        /* If p == 0, do nothing.               */
 #else
 # define GC_add_to_our_memory(p, bytes)
 #endif
-  
+
 void GC_print_obj(ptr_t p);
-                       /* P points to somewhere inside an object with  */
-                       /* debugging info.  Print a human readable      */
-                       /* description of the object to stderr.         */
+                        /* P points to somewhere inside an object with  */
+                        /* debugging info.  Print a human readable      */
+                        /* description of the object to stderr.         */
 extern void (*GC_check_heap)(void);
-                       /* Check that all objects in the heap with      */
-                       /* debugging info are intact.                   */
-                       /* Add any that are not to GC_smashed list.     */
+                        /* Check that all objects in the heap with      */
+                        /* debugging info are intact.                   */
+                        /* Add any that are not to GC_smashed list.     */
 extern void (*GC_print_all_smashed) (void);
-                       /* Print GC_smashed if it's not empty.          */
-                       /* Clear GC_smashed list.                       */
+                        /* Print GC_smashed if it's not empty.          */
+                        /* Clear GC_smashed list.                       */
 extern void GC_print_all_errors (void);
-                       /* Print smashed and leaked objects, if any.    */
-                       /* Clear the lists of such objects.             */
+                        /* Print smashed and leaked objects, if any.    */
+                        /* Clear the lists of such objects.             */
 extern void (*GC_print_heap_obj) (ptr_t p);
-                       /* If possible print s followed by a more       */
-                       /* detailed description of the object           */
-                       /* referred to by p.                            */
+                        /* If possible print s followed by a more       */
+                        /* detailed description of the object           */
+                        /* referred to by p.                            */
 #if defined(LINUX) && defined(__ELF__) && !defined(SMALL_CONFIG)
   void GC_print_address_map (void);
-                       /* Print an address map of the process.         */
+                        /* Print an address map of the process.         */
 #endif
 
-extern GC_bool GC_have_errors;  /* We saw a smashed or leaked object.  */
-                               /* Call error printing routine          */
-                               /* occasionally.                        */
+extern GC_bool GC_have_errors;  /* We saw a smashed or leaked object.   */
+                                /* Call error printing routine          */
+                                /* occasionally.                        */
 
 #ifndef SMALL_CONFIG
-  extern int GC_print_stats;   /* Nonzero generates basic GC log.      */
-                               /* VERBOSE generates add'l messages.    */
+  extern int GC_print_stats;    /* Nonzero generates basic GC log.      */
+                                /* VERBOSE generates add'l messages.    */
 #else
 # define GC_print_stats 0
-       /* Will this keep the message character strings from the executable? */
-       /* It should ...                                                     */
+        /* Will this keep the message character strings from the executable? */
+        /* It should ...                                                     */
 #endif
 #define VERBOSE 2
 
@@ -1868,15 +1868,15 @@ extern GC_bool GC_print_back_height;
   void GC_print_back_graph_stats(void);
 #endif
 
-/* Macros used for collector internal allocation.      */
-/* These assume the collector lock is held.            */
+/* Macros used for collector internal allocation.       */
+/* These assume the collector lock is held.             */
 #ifdef DBG_HDRS_ALL
     extern void * GC_debug_generic_malloc_inner(size_t lb, int k);
     extern void * GC_debug_generic_malloc_inner_ignore_off_page(size_t lb,
-                                                               int k);
+                                                                int k);
 #   define GC_INTERNAL_MALLOC GC_debug_generic_malloc_inner
 #   define GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE \
-                GC_debug_generic_malloc_inner_ignore_off_page
+                 GC_debug_generic_malloc_inner_ignore_off_page
 #   ifdef THREADS
 #       define GC_INTERNAL_FREE GC_debug_free_inner
 #   else
@@ -1885,7 +1885,7 @@ extern GC_bool GC_print_back_height;
 #else
 #   define GC_INTERNAL_MALLOC GC_generic_malloc_inner
 #   define GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE \
-                GC_generic_malloc_inner_ignore_off_page
+                 GC_generic_malloc_inner_ignore_off_page
 #   ifdef THREADS
 #       define GC_INTERNAL_FREE GC_free_inner
 #   else
@@ -1902,35 +1902,35 @@ extern GC_bool GC_print_back_height;
   void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2, size_t bytes2);
 #endif
 
-/* Virtual dirty bit implementation:           */
-/* Each implementation exports the following:  */
+/* Virtual dirty bit implementation:            */
+/* Each implementation exports the following:   */
 void GC_read_dirty(void);
-                       /* Retrieve dirty bits. */
+                        /* Retrieve dirty bits. */
 GC_bool GC_page_was_dirty(struct hblk *h);
-                       /* Read retrieved dirty bits.   */
+                        /* Read retrieved dirty bits.   */
 GC_bool GC_page_was_ever_dirty(struct hblk *h);
-                       /* Could the page contain valid heap pointers?  */
+                        /* Could the page contain valid heap pointers?  */
 void GC_remove_protection(struct hblk *h, word nblocks,
-                         GC_bool pointerfree);
-                       /* h is about to be written or allocated.  Ensure   */
-                       /* that it's not write protected by the virtual     */
-                       /* dirty bit implementation.                        */
-                       
+                          GC_bool pointerfree);
+                        /* h is about to be written or allocated.  Ensure   */
+                        /* that it's not write protected by the virtual     */
+                        /* dirty bit implementation.                        */
+
 void GC_dirty_init(void);
-  
+
 /* Slow/general mark bit manipulation: */
 GC_API_PRIV GC_bool GC_is_marked(ptr_t p);
 void GC_clear_mark_bit(ptr_t p);
 void GC_set_mark_bit(ptr_t p);
-  
+
 /* Stubborn objects: */
-void GC_read_changed(void);    /* Analogous to GC_read_dirty */
+void GC_read_changed(void);     /* Analogous to GC_read_dirty */
 GC_bool GC_page_was_changed(struct hblk * h);
-                               /* Analogous to GC_page_was_dirty */
+                                /* Analogous to GC_page_was_dirty */
 void GC_clean_changing_list(void);
-                               /* Collect obsolete changing list entries */
+                                /* Collect obsolete changing list entries */
 void GC_stubborn_init(void);
-  
+
 /* Debugging print routines: */
 void GC_print_block_list(void);
 void GC_print_hblkfreelist(void);
@@ -1945,7 +1945,7 @@ void GC_print_finalization_stats(void);
 #  define GC_STORE_BACK_PTR(source, dest) GC_store_back_pointer(source, dest)
 #  define GC_MARKED_FOR_FINALIZATION(dest) GC_marked_for_finalization(dest)
 #else
-#  define GC_STORE_BACK_PTR(source, dest) 
+#  define GC_STORE_BACK_PTR(source, dest)
 #  define GC_MARKED_FOR_FINALIZATION(dest)
 #endif
 
@@ -1965,47 +1965,47 @@ GC_API void GC_CALL GC_noop1(word);
 #ifndef GC_ATTR_FORMAT_PRINTF
 # if defined(__GNUC__) && __GNUC__ >= 3
 #   define GC_ATTR_FORMAT_PRINTF(spec_argnum, first_checked) \
-       __attribute__((__format__(__printf__, spec_argnum, first_checked)))
+        __attribute__((__format__(__printf__, spec_argnum, first_checked)))
 # else
 #   define GC_ATTR_FORMAT_PRINTF(spec_argnum, first_checked)
 # endif
 #endif
 
-/* Logging and diagnostic output:      */
+/* Logging and diagnostic output:       */
 GC_API_PRIV void GC_printf(const char * format, ...)
-                       GC_ATTR_FORMAT_PRINTF(1, 2);
-                       /* A version of printf that doesn't allocate,   */
-                       /* 1K total output length.                      */
-                       /* (We use sprintf.  Hopefully that doesn't     */
-                       /* allocate for long arguments.)                */
+                        GC_ATTR_FORMAT_PRINTF(1, 2);
+                        /* A version of printf that doesn't allocate,   */
+                        /* 1K total output length.                      */
+                        /* (We use sprintf.  Hopefully that doesn't     */
+                        /* allocate for long arguments.)                */
 GC_API_PRIV void GC_err_printf(const char * format, ...)
-                       GC_ATTR_FORMAT_PRINTF(1, 2);
+                        GC_ATTR_FORMAT_PRINTF(1, 2);
 GC_API_PRIV void GC_log_printf(const char * format, ...)
-                       GC_ATTR_FORMAT_PRINTF(1, 2);
+                        GC_ATTR_FORMAT_PRINTF(1, 2);
 void GC_err_puts(const char *s);
-                       /* Write s to stderr, don't buffer, don't add   */
-                       /* newlines, don't ...                          */
+                        /* Write s to stderr, don't buffer, don't add   */
+                        /* newlines, don't ...                          */
 
 #if defined(LINUX) && !defined(SMALL_CONFIG)
   void GC_err_write(const char *buf, size_t len);
-                       /* Write buf to stderr, don't buffer, don't add */
-                       /* newlines, don't ...                          */
+                        /* Write buf to stderr, don't buffer, don't add */
+                        /* newlines, don't ...                          */
 #endif
 
 
 # ifdef GC_ASSERTIONS
-#      define GC_ASSERT(expr) if(!(expr)) {\
-               GC_err_printf("Assertion failure: %s:%ld\n", \
-                               __FILE__, (unsigned long)__LINE__); \
-               ABORT("assertion failure"); }
-# else 
-#      define GC_ASSERT(expr)
+#       define GC_ASSERT(expr) if(!(expr)) {\
+                GC_err_printf("Assertion failure: %s:%ld\n", \
+                                __FILE__, (unsigned long)__LINE__); \
+                ABORT("assertion failure"); }
+# else
+#       define GC_ASSERT(expr)
 # endif
 
-/* Check a compile time assertion at compile time.  The error  */
-/* message for failure is a bit baroque, but ...               */
+/* Check a compile time assertion at compile time.  The error   */
+/* message for failure is a bit baroque, but ...                */
 #if defined(mips) && !defined(__GNUC__)
-/* DOB: MIPSPro C gets an internal error taking the sizeof an array type. 
+/* DOB: MIPSPro C gets an internal error taking the sizeof an array type.
    This code works correctly (ugliness is to avoid "unused var" warnings) */
 # define GC_STATIC_ASSERT(expr) do { if (0) { char j[(expr)? 1 : -1]; j[0]='\0'; j[0]=j[0]; } } while(0)
 #else
@@ -2013,55 +2013,55 @@ void GC_err_puts(const char *s);
 #endif
 
 # if defined(PARALLEL_MARK)
-    /* We need additional synchronization facilities from the thread   */
-    /* support.  We believe these are less performance critical                */
-    /* than the main garbage collector lock; standard pthreads-based   */
-    /* implementations should be sufficient.                           */
-
-    /* The mark lock and condition variable.  If the GC lock is also   */
-    /* acquired, the GC lock must be acquired first.  The mark lock is */
-    /* used to both protect some variables used by the parallel                */
-    /* marker, and to protect GC_fl_builder_count, below.              */
-    /* GC_notify_all_marker() is called when                           */ 
-    /* the state of the parallel marker changes                                */
-    /* in some significant way (see gc_mark.h for details).  The       */
-    /* latter set of events includes incrementing GC_mark_no.          */
-    /* GC_notify_all_builder() is called when GC_fl_builder_count      */
-    /* reaches 0.                                                      */
+    /* We need additional synchronization facilities from the thread    */
+    /* support.  We believe these are less performance critical         */
+    /* than the main garbage collector lock; standard pthreads-based    */
+    /* implementations should be sufficient.                            */
+
+    /* The mark lock and condition variable.  If the GC lock is also    */
+    /* acquired, the GC lock must be acquired first.  The mark lock is  */
+    /* used to both protect some variables used by the parallel         */
+    /* marker, and to protect GC_fl_builder_count, below.               */
+    /* GC_notify_all_marker() is called when                            */
+    /* the state of the parallel marker changes                         */
+    /* in some significant way (see gc_mark.h for details).  The        */
+    /* latter set of events includes incrementing GC_mark_no.           */
+    /* GC_notify_all_builder() is called when GC_fl_builder_count       */
+    /* reaches 0.                                                       */
 
      void GC_acquire_mark_lock(void);
      void GC_release_mark_lock(void);
      void GC_notify_all_builder(void);
      void GC_wait_for_reclaim(void);
 
-     extern word GC_fl_builder_count;  /* Protected by mark lock.      */
+     extern word GC_fl_builder_count;   /* Protected by mark lock.      */
 
      void GC_notify_all_marker(void);
      void GC_wait_marker(void);
-     extern word GC_mark_no;           /* Protected by mark lock.      */
+     extern word GC_mark_no;            /* Protected by mark lock.      */
 
      extern void GC_help_marker(word my_mark_no);
-               /* Try to help out parallel marker for mark cycle       */
-               /* my_mark_no.  Returns if the mark cycle finishes or   */
-               /* was already done, or there was nothing to do for     */
-               /* some other reason.                                   */
+                /* Try to help out parallel marker for mark cycle       */
+                /* my_mark_no.  Returns if the mark cycle finishes or   */
+                /* was already done, or there was nothing to do for     */
+                /* some other reason.                                   */
 # endif /* PARALLEL_MARK */
 
 # if defined(GC_PTHREADS)
-  /* We define the thread suspension signal here, so that we can refer */
-  /* to it in the dirty bit implementation, if necessary.  Ideally we  */
+  /* We define the thread suspension signal here, so that we can refer  */
+  /* to it in the dirty bit implementation, if necessary.  Ideally we   */
   /* would allocate a (real-time ?) signal using the standard mechanism.*/
-  /* unfortunately, there is no standard mechanism.  (There is one     */
-  /* in Linux glibc, but it's not exported.)  Thus we continue to use  */
-  /* the same hard-coded signals we've always used.                    */
+  /* unfortunately, there is no standard mechanism.  (There is one      */
+  /* in Linux glibc, but it's not exported.)  Thus we continue to use   */
+  /* the same hard-coded signals we've always used.                     */
 #  if !defined(SIG_SUSPEND)
 #   if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
 #    if defined(SPARC) && !defined(SIGPWR)
        /* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
-        * It is aliased to SIGLOST in asm/signal.h, though.            */
+        * It is aliased to SIGLOST in asm/signal.h, though.             */
 #      define SIG_SUSPEND SIGLOST
 #    else
-       /* Linuxthreads itself uses SIGUSR1 and SIGUSR2.                        */
+       /* Linuxthreads itself uses SIGUSR1 and SIGUSR2.                 */
 #      define SIG_SUSPEND SIGPWR
 #    endif
 #   else  /* !GC_LINUX_THREADS */
@@ -2069,23 +2069,23 @@ void GC_err_puts(const char *s);
 #       define SIG_SUSPEND _SIGRTMIN + 6
 #     else
 #       define SIG_SUSPEND SIGRTMIN + 6
-#     endif       
+#     endif
 #   endif
 #  endif /* !SIG_SUSPEND */
-  
+
 # endif
-     
-/* Some macros for setjmp that works across signal handlers    */
-/* were possible, and a couple of routines to facilitate       */
-/* catching accesses to bad addresses when that's              */
-/* possible/needed.                                            */
+
+/* Some macros for setjmp that works across signal handlers     */
+/* were possible, and a couple of routines to facilitate        */
+/* catching accesses to bad addresses when that's               */
+/* possible/needed.                                             */
 #if defined(UNIX_LIKE) || (defined(NEED_FIND_LIMIT) && defined(CYGWIN32))
 # include <setjmp.h>
 # if defined(SUNOS5SIGS) && !defined(FREEBSD)
 #  include <sys/siginfo.h>
 # endif
-  /* Define SETJMP and friends to be the version that restores */
-  /* the signal mask.                                          */
+  /* Define SETJMP and friends to be the version that restores  */
+  /* the signal mask.                                           */
 # define SETJMP(env) sigsetjmp(env, 1)
 # define LONGJMP(env, val) siglongjmp(env, val)
 # define JMP_BUF sigjmp_buf
@@ -2099,8 +2099,8 @@ void GC_err_puts(const char *s);
 # define JMP_BUF jmp_buf
 #endif
 
-/* Do we need the GC_find_limit machinery to find the end of a         */
-/* data segment.                                               */
+/* Do we need the GC_find_limit machinery to find the end of a  */
+/* data segment.                                                */
 # if defined(HEURISTIC2) || defined(SEARCH_FOR_DATA_START)
 #   define NEED_FIND_LIMIT
 # endif
@@ -2124,7 +2124,7 @@ void GC_err_puts(const char *s);
 
 #if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__) \
     && !defined(NEED_FIND_LIMIT)
-   /* Used by GC_init_netbsd_elf() in os_dep.c.        */
+   /* Used by GC_init_netbsd_elf() in os_dep.c. */
 #  define NEED_FIND_LIMIT
 #endif
 
@@ -2137,13 +2137,13 @@ void GC_err_puts(const char *s);
      defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)
 JMP_BUF GC_jmp_buf;
 
-/* Set up a handler for address faults which will longjmp to   */
-/* GC_jmp_buf;                                                 */
+/* Set up a handler for address faults which will longjmp to    */
+/* GC_jmp_buf;                                                  */
 extern void GC_setup_temporary_fault_handler(void);
 
-/* Undo the effect of GC_setup_temporary_fault_handler.                */
+/* Undo the effect of GC_setup_temporary_fault_handler.         */
 extern void GC_reset_fault_handler(void);
 
-# endif /* Need to handle address faults.      */
+# endif /* Need to handle address faults.       */
 
 # endif /* GC_PRIVATE_H */
diff --git a/mark.c b/mark.c
index d7df8c7..22851ea 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -1,4 +1,3 @@
-
 /*
  * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  * Copyright (c) 1991-1995 by Xerox Corporation.  All rights reserved.
@@ -15,7 +14,6 @@
  *
  */
 
-
 # include <stdio.h>
 # include "private/gc_pmark.h"
 
@@ -48,27 +46,27 @@ GC_API void GC_CALL GC_noop1(word x)
 
 unsigned GC_n_mark_procs = GC_RESERVED_MARK_PROCS;
 
-/* Initialize GC_obj_kinds properly and standard free lists properly.          */
-/* This must be done statically since they may be accessed before      */
-/* GC_init is called.                                                  */
-/* It's done here, since we need to deal with mark descriptors.                */
+/* Initialize GC_obj_kinds properly and standard free lists properly.   */
+/* This must be done statically since they may be accessed before       */
+/* GC_init is called.                                                   */
+/* It's done here, since we need to deal with mark descriptors.         */
 struct obj_kind GC_obj_kinds[MAXOBJKINDS] = {
 /* PTRFREE */ { &GC_aobjfreelist[0], 0 /* filled in dynamically */,
-               0 | GC_DS_LENGTH, FALSE, FALSE },
+                0 | GC_DS_LENGTH, FALSE, FALSE },
 /* NORMAL  */ { &GC_objfreelist[0], 0,
-               0 | GC_DS_LENGTH,  /* Adjusted in GC_init for EXTRA_BYTES */
-               TRUE /* add length to descr */, TRUE },
+                0 | GC_DS_LENGTH,  /* Adjusted in GC_init for EXTRA_BYTES */
+                TRUE /* add length to descr */, TRUE },
 /* UNCOLLECTABLE */
-             { &GC_uobjfreelist[0], 0,
-               0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE },
+              { &GC_uobjfreelist[0], 0,
+                0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE },
 # ifdef ATOMIC_UNCOLLECTABLE
    /* AUNCOLLECTABLE */
-             { &GC_auobjfreelist[0], 0,
-               0 | GC_DS_LENGTH, FALSE /* add length to descr */, FALSE },
+              { &GC_auobjfreelist[0], 0,
+                0 | GC_DS_LENGTH, FALSE /* add length to descr */, FALSE },
 # endif
 # ifdef STUBBORN_ALLOC
 /*STUBBORN*/ { (void **)&GC_sobjfreelist[0], 0,
-               0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE },
+                0 | GC_DS_LENGTH, TRUE /* add length to descr */, TRUE },
 # endif
 };
 
@@ -89,12 +87,12 @@ struct obj_kind GC_obj_kinds[MAXOBJKINDS] = {
 
 # ifndef INITIAL_MARK_STACK_SIZE
 #   define INITIAL_MARK_STACK_SIZE (1*HBLKSIZE)
-               /* INITIAL_MARK_STACK_SIZE * sizeof(mse) should be a    */
-               /* multiple of HBLKSIZE.                                */
-               /* The incremental collector actually likes a larger    */
-               /* size, since it want to push all marked dirty objs    */
-               /* before marking anything new.  Currently we let it    */
-               /* grow dynamically.                                    */
+                /* INITIAL_MARK_STACK_SIZE * sizeof(mse) should be a    */
+                /* multiple of HBLKSIZE.                                */
+                /* The incremental collector actually likes a larger    */
+                /* size, since it want to push all marked dirty objs    */
+                /* before marking anything new.  Currently we let it    */
+                /* grow dynamically.                                    */
 # endif
 
 /*
@@ -104,22 +102,22 @@ struct obj_kind GC_obj_kinds[MAXOBJKINDS] = {
  */
 
 STATIC word GC_n_rescuing_pages;/* Number of dirty pages we marked from */
-                               /* excludes ptrfree pages, etc.         */
+                                /* excludes ptrfree pages, etc.         */
 
 mse * GC_mark_stack;
 
 mse * GC_mark_stack_limit;
 
 size_t GC_mark_stack_size = 0;
+
 #ifdef PARALLEL_MARK
   mse * volatile GC_mark_stack_top;
-  /* Updated only with mark lock held, but read asynchronously.        */
+  /* Updated only with mark lock held, but read asynchronously. */
   volatile AO_t GC_first_nonempty;
-       /* Lowest entry on mark stack   */
-       /* that may be nonempty.        */
-       /* Updated only by initiating   */
-       /* thread.                      */
+        /* Lowest entry on mark stack   */
+        /* that may be nonempty.        */
+        /* Updated only by initiating   */
+        /* thread.                      */
 #else
   mse * GC_mark_stack_top;
 #endif
@@ -130,12 +128,12 @@ mark_state_t GC_mark_state = MS_NONE;
 
 GC_bool GC_mark_stack_too_small = FALSE;
 
-GC_bool GC_objects_are_marked = FALSE; /* Are there collectable marked */
-                                       /* objects in the heap?         */
+GC_bool GC_objects_are_marked = FALSE;  /* Are there collectable marked */
+                                        /* objects in the heap?         */
 
-/* Is a collection in progress?  Note that this can return true in the */
-/* nonincremental case, if a collection has been abandoned and the     */
-/* mark state is now MS_INVALID.                                       */
+/* Is a collection in progress?  Note that this can return true in the  */
+/* nonincremental case, if a collection has been abandoned and the      */
+/* mark state is now MS_INVALID.                                        */
 GC_bool GC_collection_in_progress(void)
 {
     return(GC_mark_state != MS_NONE);
@@ -165,11 +163,11 @@ void GC_set_hdr_marks(hdr *hhdr)
 
 #   ifdef USE_MARK_BYTES
       for (i = 0; i <= n_marks; i += (unsigned)MARK_BIT_OFFSET(sz)) {
-       hhdr -> hb_marks[i] = 1;
+        hhdr -> hb_marks[i] = 1;
       }
 #   else
       for (i = 0; i < divWORDSZ(n_marks + WORDSZ); ++i) {
-       hhdr -> hb_marks[i] = ONES;
+        hhdr -> hb_marks[i] = ONES;
       }
 #   endif
 #   ifdef MARK_BIT_PER_OBJ
@@ -186,11 +184,11 @@ void GC_set_hdr_marks(hdr *hhdr)
 static void clear_marks_for_block(struct hblk *h, word dummy)
 {
     register hdr * hhdr = HDR(h);
-    
+
     if (IS_UNCOLLECTABLE(hhdr -> hb_obj_kind)) return;
-        /* Mark bit for these is cleared only once the object is       */
-        /* explicitly deallocated.  This either frees the block, or    */
-        /* the bit is cleared once the object is on the free list.     */
+        /* Mark bit for these is cleared only once the object is        */
+        /* explicitly deallocated.  This either frees the block, or     */
+        /* the bit is cleared once the object is on the free list.      */
     GC_clear_hdr_marks(hhdr);
 }
 
@@ -200,7 +198,7 @@ void GC_set_mark_bit(ptr_t p)
     struct hblk *h = HBLKPTR(p);
     hdr * hhdr = HDR(h);
     word bit_no = MARK_BIT_NO(p - (ptr_t)h, hhdr -> hb_sz);
-    
+
     if (!mark_bit_from_hdr(hhdr, bit_no)) {
       set_mark_bit_from_hdr(hhdr, bit_no);
       ++hhdr -> hb_n_marks;
@@ -212,19 +210,19 @@ void GC_clear_mark_bit(ptr_t p)
     struct hblk *h = HBLKPTR(p);
     hdr * hhdr = HDR(h);
     word bit_no = MARK_BIT_NO(p - (ptr_t)h, hhdr -> hb_sz);
-    
+
     if (mark_bit_from_hdr(hhdr, bit_no)) {
       size_t n_marks;
       clear_mark_bit_from_hdr(hhdr, bit_no);
       n_marks = hhdr -> hb_n_marks - 1;
 #     ifdef PARALLEL_MARK
         if (n_marks != 0 || !GC_parallel)
-          hhdr -> hb_n_marks = n_marks; 
-        /* Don't decrement to zero.  The counts are approximate due to */
-        /* concurrency issues, but we need to ensure that a count of   */
-        /* zero implies an empty block.                                        */
+          hhdr -> hb_n_marks = n_marks;
+        /* Don't decrement to zero.  The counts are approximate due to  */
+        /* concurrency issues, but we need to ensure that a count of    */
+        /* zero implies an empty block.                                 */
 #     else
-          hhdr -> hb_n_marks = n_marks; 
+          hhdr -> hb_n_marks = n_marks;
 #     endif
     }
 }
@@ -234,7 +232,7 @@ GC_bool GC_is_marked(ptr_t p)
     struct hblk *h = HBLKPTR(p);
     hdr * hhdr = HDR(h);
     word bit_no = MARK_BIT_NO(p - (ptr_t)h, hhdr -> hb_sz);
-    
+
     return((GC_bool)mark_bit_from_hdr(hhdr, bit_no));
 }
 
@@ -256,24 +254,24 @@ void GC_clear_marks(void)
 extern void GC_check_dirty(void);
 #endif
 
-/* Initiate a garbage collection.  Initiates a full collection if the  */
-/* mark        state is invalid.                                               */
+/* Initiate a garbage collection.  Initiates a full collection if the   */
+/* mark state is invalid.                                               */
 void GC_initiate_gc(void)
 {
     if (GC_dirty_maintained) GC_read_dirty();
 #   ifdef STUBBORN_ALLOC
-       GC_read_changed();
+        GC_read_changed();
 #   endif
 #   ifdef CHECKSUMS
-       if (GC_dirty_maintained) GC_check_dirty();
+        if (GC_dirty_maintained) GC_check_dirty();
 #   endif
     GC_n_rescuing_pages = 0;
     if (GC_mark_state == MS_NONE) {
         GC_mark_state = MS_PUSH_RESCUERS;
     } else if (GC_mark_state != MS_INVALID) {
-       ABORT("unexpected state");
-    } /* else this is really a full collection, and mark       */
-      /* bits are invalid.                                     */
+        ABORT("unexpected state");
+    } /* else this is really a full collection, and mark        */
+      /* bits are invalid.                                      */
     scan_ptr = 0;
 }
 
@@ -284,154 +282,154 @@ void GC_initiate_gc(void)
 static void alloc_mark_stack(size_t);
 
 # if (defined(MSWIN32) || defined(MSWINCE)) && !defined(__GNUC__) \
-       || defined(MSWIN32) && defined(I386) /* for Win98 */ \
-       || defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)
+        || defined(MSWIN32) && defined(I386) /* for Win98 */ \
+        || defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)
     /* Under rare conditions, we may end up marking from nonexistent memory. */
-    /* Hence we need to be prepared to recover by running GC_mark_some      */
-    /* with a suitable handler in place.                                    */
-    /* FIXME: Should we really need it for WinCE?  If yes then         */
-    /* WRAP_MARK_SOME should be also defined for CeGCC which requires  */
-    /* CPU/OS-specific code in mark_ex_handler() and GC_mark_some()    */
-    /* (for manual stack unwinding and exception handler installation).        */
+    /* Hence we need to be prepared to recover by running GC_mark_some       */
+    /* with a suitable handler in place.                                     */
+    /* FIXME: Should we really need it for WinCE?  If yes then          */
+    /* WRAP_MARK_SOME should be also defined for CeGCC which requires   */
+    /* CPU/OS-specific code in mark_ex_handler() and GC_mark_some()     */
+    /* (for manual stack unwinding and exception handler installation). */
 #   define WRAP_MARK_SOME
 # endif
 
-/* Perform a small amount of marking.                  */
-/* We try to touch roughly a page of memory.           */
-/* Return TRUE if we just finished a mark phase.       */
-/* Cold_gc_frame is an address inside a GC frame that  */
-/* remains valid until all marking is complete.                */
-/* A zero value indicates that it's OK to miss some    */
-/* register values.                                    */
-/* We hold the allocation lock.  In the case of        */
+/* Perform a small amount of marking.                   */
+/* We try to touch roughly a page of memory.            */
+/* Return TRUE if we just finished a mark phase.        */
+/* Cold_gc_frame is an address inside a GC frame that   */
+/* remains valid until all marking is complete.         */
+/* A zero value indicates that it's OK to miss some     */
+/* register values.                                     */
+/* We hold the allocation lock.  In the case of         */
 /* incremental collection, the world may not be stopped.*/
 #ifdef WRAP_MARK_SOME
-  /* For win32, this is called after we establish a structured */
-  /* exception handler, in case Windows unmaps one of our root */
-  /* segments.  See below.  In either case, we acquire the     */
-  /* allocator lock long before we get here.                   */
+  /* For win32, this is called after we establish a structured  */
+  /* exception handler, in case Windows unmaps one of our root  */
+  /* segments.  See below.  In either case, we acquire the      */
+  /* allocator lock long before we get here.                    */
   STATIC GC_bool GC_mark_some_inner(ptr_t cold_gc_frame)
 #else
   GC_bool GC_mark_some(ptr_t cold_gc_frame)
 #endif
 {
     switch(GC_mark_state) {
-       case MS_NONE:
-           return(FALSE);
-           
-       case MS_PUSH_RESCUERS:
-           if (GC_mark_stack_top
-               >= GC_mark_stack_limit - INITIAL_MARK_STACK_SIZE/2) {
-               /* Go ahead and mark, even though that might cause us to */
-               /* see more marked dirty objects later on.  Avoid this   */
-               /* in the future.                                        */
-               GC_mark_stack_too_small = TRUE;
-               MARK_FROM_MARK_STACK();
-               return(FALSE);
-           } else {
-               scan_ptr = GC_push_next_marked_dirty(scan_ptr);
-               if (scan_ptr == 0) {
-                   if (GC_print_stats) {
-                       GC_log_printf("Marked from %lu dirty pages\n",
-                                     (unsigned long)GC_n_rescuing_pages);
-                   }
-                   GC_push_roots(FALSE, cold_gc_frame);
-                   GC_objects_are_marked = TRUE;
-                   if (GC_mark_state != MS_INVALID) {
-                       GC_mark_state = MS_ROOTS_PUSHED;
-                   }
-               }
-           }
-           return(FALSE);
-       
-       case MS_PUSH_UNCOLLECTABLE:
-           if (GC_mark_stack_top
-               >= GC_mark_stack + GC_mark_stack_size/4) {
-#              ifdef PARALLEL_MARK
-                 /* Avoid this, since we don't parallelize the marker  */
-                 /* here.                                              */
-                 if (GC_parallel) GC_mark_stack_too_small = TRUE;
-#              endif
-               MARK_FROM_MARK_STACK();
-               return(FALSE);
-           } else {
-               scan_ptr = GC_push_next_marked_uncollectable(scan_ptr);
-               if (scan_ptr == 0) {
-                   GC_push_roots(TRUE, cold_gc_frame);
-                   GC_objects_are_marked = TRUE;
-                   if (GC_mark_state != MS_INVALID) {
-                       GC_mark_state = MS_ROOTS_PUSHED;
-                   }
-               }
-           }
-           return(FALSE);
-       
-       case MS_ROOTS_PUSHED:
-#          ifdef PARALLEL_MARK
-             /* In the incremental GC case, this currently doesn't     */
-             /* quite do the right thing, since it runs to             */
-             /* completion.  On the other hand, starting a             */
-             /* parallel marker is expensive, so perhaps it is         */
-             /* the right thing?                                       */
-             /* Eventually, incremental marking should run             */
-             /* asynchronously in multiple threads, without grabbing   */
-             /* the allocation lock.                                   */
-               if (GC_parallel) {
-                 GC_do_parallel_mark();
-                 GC_ASSERT(GC_mark_stack_top < (mse *)GC_first_nonempty);
-                 GC_mark_stack_top = GC_mark_stack - 1;
-                 if (GC_mark_stack_too_small) {
-                   alloc_mark_stack(2*GC_mark_stack_size);
-                 }
-                 if (GC_mark_state == MS_ROOTS_PUSHED) {
-                   GC_mark_state = MS_NONE;
-                   return(TRUE);
-                 } else {
-                   return(FALSE);
-                 }
-               }
-#          endif
-           if (GC_mark_stack_top >= GC_mark_stack) {
-               MARK_FROM_MARK_STACK();
-               return(FALSE);
-           } else {
-               GC_mark_state = MS_NONE;
-               if (GC_mark_stack_too_small) {
-                   alloc_mark_stack(2*GC_mark_stack_size);
-               }
-               return(TRUE);
-           }
-           
-       case MS_INVALID:
-       case MS_PARTIALLY_INVALID:
-           if (!GC_objects_are_marked) {
-               GC_mark_state = MS_PUSH_UNCOLLECTABLE;
-               return(FALSE);
-           }
-           if (GC_mark_stack_top >= GC_mark_stack) {
-               MARK_FROM_MARK_STACK();
-               return(FALSE);
-           }
-           if (scan_ptr == 0 && GC_mark_state == MS_INVALID) {
-               /* About to start a heap scan for marked objects. */
-               /* Mark stack is empty.  OK to reallocate.        */
-               if (GC_mark_stack_too_small) {
-                   alloc_mark_stack(2*GC_mark_stack_size);
-               }
-               GC_mark_state = MS_PARTIALLY_INVALID;
-           }
-           scan_ptr = GC_push_next_marked(scan_ptr);
-           if (scan_ptr == 0 && GC_mark_state == MS_PARTIALLY_INVALID) {
-               GC_push_roots(TRUE, cold_gc_frame);
-               GC_objects_are_marked = TRUE;
-               if (GC_mark_state != MS_INVALID) {
-                   GC_mark_state = MS_ROOTS_PUSHED;
-               }
-           }
-           return(FALSE);
-       default:
-           ABORT("GC_mark_some: bad state");
-           return(FALSE);
+        case MS_NONE:
+            return(FALSE);
+
+        case MS_PUSH_RESCUERS:
+            if (GC_mark_stack_top
+                >= GC_mark_stack_limit - INITIAL_MARK_STACK_SIZE/2) {
+                /* Go ahead and mark, even though that might cause us to */
+                /* see more marked dirty objects later on.  Avoid this   */
+                /* in the future.                                        */
+                GC_mark_stack_too_small = TRUE;
+                MARK_FROM_MARK_STACK();
+                return(FALSE);
+            } else {
+                scan_ptr = GC_push_next_marked_dirty(scan_ptr);
+                if (scan_ptr == 0) {
+                    if (GC_print_stats) {
+                        GC_log_printf("Marked from %lu dirty pages\n",
+                                      (unsigned long)GC_n_rescuing_pages);
+                    }
+                    GC_push_roots(FALSE, cold_gc_frame);
+                    GC_objects_are_marked = TRUE;
+                    if (GC_mark_state != MS_INVALID) {
+                        GC_mark_state = MS_ROOTS_PUSHED;
+                    }
+                }
+            }
+            return(FALSE);
+
+        case MS_PUSH_UNCOLLECTABLE:
+            if (GC_mark_stack_top
+                >= GC_mark_stack + GC_mark_stack_size/4) {
+#               ifdef PARALLEL_MARK
+                  /* Avoid this, since we don't parallelize the marker  */
+                  /* here.                                              */
+                  if (GC_parallel) GC_mark_stack_too_small = TRUE;
+#               endif
+                MARK_FROM_MARK_STACK();
+                return(FALSE);
+            } else {
+                scan_ptr = GC_push_next_marked_uncollectable(scan_ptr);
+                if (scan_ptr == 0) {
+                    GC_push_roots(TRUE, cold_gc_frame);
+                    GC_objects_are_marked = TRUE;
+                    if (GC_mark_state != MS_INVALID) {
+                        GC_mark_state = MS_ROOTS_PUSHED;
+                    }
+                }
+            }
+            return(FALSE);
+
+        case MS_ROOTS_PUSHED:
+#           ifdef PARALLEL_MARK
+              /* In the incremental GC case, this currently doesn't     */
+              /* quite do the right thing, since it runs to             */
+              /* completion.  On the other hand, starting a             */
+              /* parallel marker is expensive, so perhaps it is         */
+              /* the right thing?                                       */
+              /* Eventually, incremental marking should run             */
+              /* asynchronously in multiple threads, without grabbing   */
+              /* the allocation lock.                                   */
+                if (GC_parallel) {
+                  GC_do_parallel_mark();
+                  GC_ASSERT(GC_mark_stack_top < (mse *)GC_first_nonempty);
+                  GC_mark_stack_top = GC_mark_stack - 1;
+                  if (GC_mark_stack_too_small) {
+                    alloc_mark_stack(2*GC_mark_stack_size);
+                  }
+                  if (GC_mark_state == MS_ROOTS_PUSHED) {
+                    GC_mark_state = MS_NONE;
+                    return(TRUE);
+                  } else {
+                    return(FALSE);
+                  }
+                }
+#           endif
+            if (GC_mark_stack_top >= GC_mark_stack) {
+                MARK_FROM_MARK_STACK();
+                return(FALSE);
+            } else {
+                GC_mark_state = MS_NONE;
+                if (GC_mark_stack_too_small) {
+                    alloc_mark_stack(2*GC_mark_stack_size);
+                }
+                return(TRUE);
+            }
+
+        case MS_INVALID:
+        case MS_PARTIALLY_INVALID:
+            if (!GC_objects_are_marked) {
+                GC_mark_state = MS_PUSH_UNCOLLECTABLE;
+                return(FALSE);
+            }
+            if (GC_mark_stack_top >= GC_mark_stack) {
+                MARK_FROM_MARK_STACK();
+                return(FALSE);
+            }
+            if (scan_ptr == 0 && GC_mark_state == MS_INVALID) {
+                /* About to start a heap scan for marked objects. */
+                /* Mark stack is empty.  OK to reallocate.        */
+                if (GC_mark_stack_too_small) {
+                    alloc_mark_stack(2*GC_mark_stack_size);
+                }
+                GC_mark_state = MS_PARTIALLY_INVALID;
+            }
+            scan_ptr = GC_push_next_marked(scan_ptr);
+            if (scan_ptr == 0 && GC_mark_state == MS_PARTIALLY_INVALID) {
+                GC_push_roots(TRUE, cold_gc_frame);
+                GC_objects_are_marked = TRUE;
+                if (GC_mark_state != MS_INVALID) {
+                    GC_mark_state = MS_ROOTS_PUSHED;
+                }
+            }
+            return(FALSE);
+        default:
+            ABORT("GC_mark_some: bad state");
+            return(FALSE);
     }
 }
 
@@ -446,7 +444,7 @@ static void alloc_mark_stack(size_t);
 
 
     static EXCEPTION_DISPOSITION mark_ex_handler(
-        struct _EXCEPTION_RECORD *ex_rec, 
+        struct _EXCEPTION_RECORD *ex_rec,
         void *est_frame,
         struct _CONTEXT *context,
         void *disp_ctxt)
@@ -476,8 +474,8 @@ static void alloc_mark_stack(size_t);
 
 #ifdef GC_WIN32_THREADS
   extern GC_bool GC_started_thread_while_stopped(void);
-  /* In win32_threads.c.  Did we invalidate mark phase with an */
-  /* unexpected thread start?                                  */
+  /* In win32_threads.c.  Did we invalidate mark phase with an  */
+  /* unexpected thread start?                                   */
 #endif
 
   GC_bool GC_mark_some(ptr_t cold_gc_frame)
@@ -495,26 +493,26 @@ static void alloc_mark_stack(size_t);
       /* This code does not appear to be necessary for Windows   */
       /* 95/NT/2000+. Note that this code should never generate  */
       /* an incremental GC write fault.                          */
-      /* This code seems to be necessary for WinCE (at least in         */
-      /* the case we'd decide to add MEM_PRIVATE sections to    */
-      /* data roots in GC_register_dynamic_libraries()).        */
-      /* It's conceivable that this is the same issue with      */
-      /* terminating threads that we see with Linux and                 */
-      /* USE_PROC_FOR_LIBRARIES.                                */
+      /* This code seems to be necessary for WinCE (at least in  */
+      /* the case we'd decide to add MEM_PRIVATE sections to     */
+      /* data roots in GC_register_dynamic_libraries()).         */
+      /* It's conceivable that this is the same issue with       */
+      /* terminating threads that we see with Linux and          */
+      /* USE_PROC_FOR_LIBRARIES.                                 */
 
       __try {
           ret_val = GC_mark_some_inner(cold_gc_frame);
       } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
                 EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
-         goto handle_ex;
+          goto handle_ex;
       }
 #     ifdef GC_WIN32_THREADS
-       /* With DllMain-based thread tracking, a thread may have        */
-       /* started while we were marking.  This is logically equivalent */
-       /* to the exception case; our results are invalid and we have   */
-       /* to start over.  This cannot be prevented since we can't      */
-       /* block in DllMain.                                            */
-       if (GC_started_thread_while_stopped()) goto handle_ex;
+        /* With DllMain-based thread tracking, a thread may have        */
+        /* started while we were marking.  This is logically equivalent */
+        /* to the exception case; our results are invalid and we have   */
+        /* to start over.  This cannot be prevented since we can't      */
+        /* block in DllMain.                                            */
+        if (GC_started_thread_while_stopped()) goto handle_ex;
 #     endif
      rm_handler:
       return ret_val;
@@ -543,14 +541,14 @@ static void alloc_mark_stack(size_t);
 
 #    endif /* __GNUC__ */
 #   else /* !MSWIN32 */
-      /* Here we are handling the case in which /proc is used for root */
-      /* finding, and we have threads.  We may find a stack for a      */
-      /* thread that is in the process of exiting, and disappears      */
-      /* while we are marking it.  This seems extremely difficult to   */
-      /* avoid otherwise.                                              */
+      /* Here we are handling the case in which /proc is used for root  */
+      /* finding, and we have threads.  We may find a stack for a       */
+      /* thread that is in the process of exiting, and disappears       */
+      /* while we are marking it.  This seems extremely difficult to    */
+      /* avoid otherwise.                                               */
       if (GC_incremental) {
-       WARN("Incremental GC incompatible with /proc roots\n", 0);
-       /* I'm not sure if this could still work ...    */
+        WARN("Incremental GC incompatible with /proc roots\n", 0);
+        /* I'm not sure if this could still work ...    */
       }
       GC_setup_temporary_fault_handler();
       if(SETJMP(GC_jmp_buf) != 0) goto handle_ex;
@@ -558,19 +556,19 @@ static void alloc_mark_stack(size_t);
     rm_handler:
       GC_reset_fault_handler();
       return ret_val;
-      
+
 #   endif /* !MSWIN32 */
 
 handle_ex:
     /* Exception handler starts here for all cases. */
       if (GC_print_stats) {
         GC_log_printf("Caught ACCESS_VIOLATION in marker. "
-                     "Memory mapping disappeared.\n");
+                      "Memory mapping disappeared.\n");
       }
 
-      /* We have bad roots on the stack.  Discard mark stack.  */
-      /* Rescan from marked objects.  Redetermine roots.       */
-      GC_invalidate_mark_state();      
+      /* We have bad roots on the stack.  Discard mark stack.   */
+      /* Rescan from marked objects.  Redetermine roots.        */
+      GC_invalidate_mark_state();
       scan_ptr = 0;
 
       ret_val = FALSE;
@@ -582,7 +580,7 @@ handle_ex:
 GC_bool GC_mark_stack_empty(void)
 {
     return(GC_mark_stack_top < GC_mark_stack);
-}      
+}
 
 void GC_invalidate_mark_state(void)
 {
@@ -595,8 +593,8 @@ mse * GC_signal_mark_stack_overflow(mse *msp)
     GC_mark_state = MS_INVALID;
     GC_mark_stack_too_small = TRUE;
     if (GC_print_stats) {
-       GC_log_printf("Mark stack overflow; current size = %lu entries\n",
-                     (unsigned long)GC_mark_stack_size);
+        GC_log_printf("Mark stack overflow; current size = %lu entries\n",
+                      (unsigned long)GC_mark_stack_size);
     }
     return(msp - GC_MARK_STACK_DISCARDS);
 }
@@ -613,21 +611,21 @@ mse * GC_signal_mark_stack_overflow(mse *msp)
  * things up.  In particular, we avoid procedure calls on the common
  * path, we take advantage of peculiarities of the mark descriptor
  * encoding, we optionally maintain a cache for the block address to
- * header mapping, we prefetch when an object is "grayed", etc. 
+ * header mapping, we prefetch when an object is "grayed", etc.
  */
 mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, mse *mark_stack_limit)
 {
-  signed_word credit = HBLKSIZE;  /* Remaining credit for marking work */
-  ptr_t current_p;     /* Pointer to current candidate ptr.    */
-  word current;        /* Candidate pointer.                   */
-  ptr_t limit; /* (Incl) limit of current candidate    */
-                               /* range                                */
+  signed_word credit = HBLKSIZE;  /* Remaining credit for marking work  */
+  ptr_t current_p;      /* Pointer to current candidate ptr.    */
+  word current; /* Candidate pointer.                   */
+  ptr_t limit;  /* (Incl) limit of current candidate    */
+                                /* range                                */
   word descr;
   ptr_t greatest_ha = GC_greatest_plausible_heap_addr;
   ptr_t least_ha = GC_least_plausible_heap_addr;
   DECLARE_HDR_CACHE;
 
-# define SPLIT_RANGE_WORDS 128  /* Must be power of 2.         */
+# define SPLIT_RANGE_WORDS 128  /* Must be power of 2.          */
 
   GC_objects_are_marked = TRUE;
   INIT_HDR_CACHE;
@@ -635,169 +633,169 @@ mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, mse *mark_stack_limit)
   while (mark_stack_top >= mark_stack && credit >= 0) {
 # else
   while ((((ptr_t)mark_stack_top - (ptr_t)mark_stack) | credit)
-       >= 0) {
+        >= 0) {
 # endif
     current_p = mark_stack_top -> mse_start;
     descr = mark_stack_top -> mse_descr;
   retry:
-    /* current_p and descr describe the current object.                */
-    /* *mark_stack_top is vacant.                              */
-    /* The following is 0 only for small objects described by a simple */
-    /* length descriptor.  For many applications this is the common    */
-    /* case, so we try to detect it quickly.                           */
+    /* current_p and descr describe the current object.         */
+    /* *mark_stack_top is vacant.                               */
+    /* The following is 0 only for small objects described by a simple  */
+    /* length descriptor.  For many applications this is the common     */
+    /* case, so we try to detect it quickly.                            */
     if (descr & ((~(WORDS_TO_BYTES(SPLIT_RANGE_WORDS) - 1)) | GC_DS_TAGS)) {
       word tag = descr & GC_DS_TAGS;
-      
+
       switch(tag) {
         case GC_DS_LENGTH:
-          /* Large length.                                             */
-          /* Process part of the range to avoid pushing too much on the        */
-          /* stack.                                                    */
-         GC_ASSERT(descr < (word)GC_greatest_plausible_heap_addr
-                           - (word)GC_least_plausible_heap_addr);
-#        ifdef ENABLE_TRACE
-           if (GC_trace_addr >= current_p
-               && GC_trace_addr < current_p + descr) {
-               GC_log_printf("GC:%u Large section; start %p len %lu\n",
-                             (unsigned)GC_gc_no, current_p,
-                             (unsigned long) descr);
-           }
-#        endif /* ENABLE_TRACE */
-#        ifdef PARALLEL_MARK
-#          define SHARE_BYTES 2048
-           if (descr > SHARE_BYTES && GC_parallel
-               && mark_stack_top < mark_stack_limit - 1) {
-             int new_size = (descr/2) & ~(sizeof(word)-1);
-             mark_stack_top -> mse_start = current_p;
-             mark_stack_top -> mse_descr = new_size + sizeof(word);
-                                       /* makes sure we handle         */
-                                       /* misaligned pointers.         */
-             mark_stack_top++;
-#            ifdef ENABLE_TRACE
-               if (GC_trace_addr >= current_p
-                   && GC_trace_addr < current_p + descr) {
-                   GC_log_printf("GC:%u splitting (parallel) %p at %p\n",
-                                 (unsigned)GC_gc_no, current_p,
-                                 current_p + new_size);
-               }
-#            endif /* ENABLE_TRACE */
-             current_p += new_size;
-             descr -= new_size;
-             goto retry;
-           }
-#        endif /* PARALLEL_MARK */
+          /* Large length.                                              */
+          /* Process part of the range to avoid pushing too much on the */
+          /* stack.                                                     */
+          GC_ASSERT(descr < (word)GC_greatest_plausible_heap_addr
+                            - (word)GC_least_plausible_heap_addr);
+#         ifdef ENABLE_TRACE
+            if (GC_trace_addr >= current_p
+                && GC_trace_addr < current_p + descr) {
+                GC_log_printf("GC:%u Large section; start %p len %lu\n",
+                              (unsigned)GC_gc_no, current_p,
+                              (unsigned long) descr);
+            }
+#         endif /* ENABLE_TRACE */
+#         ifdef PARALLEL_MARK
+#           define SHARE_BYTES 2048
+            if (descr > SHARE_BYTES && GC_parallel
+                && mark_stack_top < mark_stack_limit - 1) {
+              int new_size = (descr/2) & ~(sizeof(word)-1);
+              mark_stack_top -> mse_start = current_p;
+              mark_stack_top -> mse_descr = new_size + sizeof(word);
+                                        /* makes sure we handle         */
+                                        /* misaligned pointers.         */
+              mark_stack_top++;
+#             ifdef ENABLE_TRACE
+                if (GC_trace_addr >= current_p
+                    && GC_trace_addr < current_p + descr) {
+                    GC_log_printf("GC:%u splitting (parallel) %p at %p\n",
+                                  (unsigned)GC_gc_no, current_p,
+                                  current_p + new_size);
+                }
+#             endif /* ENABLE_TRACE */
+              current_p += new_size;
+              descr -= new_size;
+              goto retry;
+            }
+#         endif /* PARALLEL_MARK */
           mark_stack_top -> mse_start =
-               limit = current_p + WORDS_TO_BYTES(SPLIT_RANGE_WORDS-1);
+                limit = current_p + WORDS_TO_BYTES(SPLIT_RANGE_WORDS-1);
           mark_stack_top -> mse_descr =
-                       descr - WORDS_TO_BYTES(SPLIT_RANGE_WORDS-1);
-#        ifdef ENABLE_TRACE
-           if (GC_trace_addr >= current_p
-               && GC_trace_addr < current_p + descr) {
-               GC_log_printf("GC:%u splitting %p at %p\n",
-                             (unsigned)GC_gc_no, current_p, limit);
-           }
-#        endif /* ENABLE_TRACE */
-          /* Make sure that pointers overlapping the two ranges are    */
-          /* considered.                                               */
+                        descr - WORDS_TO_BYTES(SPLIT_RANGE_WORDS-1);
+#         ifdef ENABLE_TRACE
+            if (GC_trace_addr >= current_p
+                && GC_trace_addr < current_p + descr) {
+                GC_log_printf("GC:%u splitting %p at %p\n",
+                              (unsigned)GC_gc_no, current_p, limit);
+            }
+#         endif /* ENABLE_TRACE */
+          /* Make sure that pointers overlapping the two ranges are     */
+          /* considered.                                                */
           limit += sizeof(word) - ALIGNMENT;
           break;
         case GC_DS_BITMAP:
           mark_stack_top--;
-#        ifdef ENABLE_TRACE
-           if (GC_trace_addr >= current_p
-               && GC_trace_addr < current_p + WORDS_TO_BYTES(WORDSZ-2)) {
-               GC_log_printf("GC:%u Tracing from %p bitmap descr %lu\n",
-                             (unsigned)GC_gc_no, current_p,
-                             (unsigned long) descr);
-           }
-#        endif /* ENABLE_TRACE */
+#         ifdef ENABLE_TRACE
+            if (GC_trace_addr >= current_p
+                && GC_trace_addr < current_p + WORDS_TO_BYTES(WORDSZ-2)) {
+                GC_log_printf("GC:%u Tracing from %p bitmap descr %lu\n",
+                              (unsigned)GC_gc_no, current_p,
+                              (unsigned long) descr);
+            }
+#         endif /* ENABLE_TRACE */
           descr &= ~GC_DS_TAGS;
           credit -= WORDS_TO_BYTES(WORDSZ/2); /* guess */
           while (descr != 0) {
             if ((signed_word)descr < 0) {
               current = *(word *)current_p;
-             FIXUP_POINTER(current);
-             if ((ptr_t)current >= least_ha && (ptr_t)current < greatest_ha) {
-               PREFETCH((ptr_t)current);
+              FIXUP_POINTER(current);
+              if ((ptr_t)current >= least_ha && (ptr_t)current < greatest_ha) {
+                PREFETCH((ptr_t)current);
 #               ifdef ENABLE_TRACE
-                 if (GC_trace_addr == current_p) {
-                   GC_log_printf("GC:%u Considering(3) %p -> %p\n",
-                                 (unsigned)GC_gc_no, current_p,
-                                 (ptr_t) current);
-                 }
+                  if (GC_trace_addr == current_p) {
+                    GC_log_printf("GC:%u Considering(3) %p -> %p\n",
+                                  (unsigned)GC_gc_no, current_p,
+                                  (ptr_t) current);
+                  }
 #               endif /* ENABLE_TRACE */
                 PUSH_CONTENTS((ptr_t)current, mark_stack_top,
-                             mark_stack_limit, current_p, exit1);
-             }
+                              mark_stack_limit, current_p, exit1);
+              }
             }
-           descr <<= 1;
-           current_p += sizeof(word);
+            descr <<= 1;
+            current_p += sizeof(word);
           }
           continue;
         case GC_DS_PROC:
           mark_stack_top--;
-#        ifdef ENABLE_TRACE
-           if (GC_trace_addr >= current_p
-               && GC_base(current_p) != 0
-               && GC_base(current_p) == GC_base(GC_trace_addr)) {
-               GC_log_printf("GC:%u Tracing from %p proc descr %lu\n",
-                             (unsigned)GC_gc_no, current_p,
-                             (unsigned long) descr);
-           }
-#        endif /* ENABLE_TRACE */
+#         ifdef ENABLE_TRACE
+            if (GC_trace_addr >= current_p
+                && GC_base(current_p) != 0
+                && GC_base(current_p) == GC_base(GC_trace_addr)) {
+                GC_log_printf("GC:%u Tracing from %p proc descr %lu\n",
+                              (unsigned)GC_gc_no, current_p,
+                              (unsigned long) descr);
+            }
+#         endif /* ENABLE_TRACE */
           credit -= GC_PROC_BYTES;
           mark_stack_top =
               (*PROC(descr))
-                   ((word *)current_p, mark_stack_top,
-                   mark_stack_limit, ENV(descr));
+                    ((word *)current_p, mark_stack_top,
+                    mark_stack_limit, ENV(descr));
           continue;
         case GC_DS_PER_OBJECT:
-         if ((signed_word)descr >= 0) {
-           /* Descriptor is in the object.     */
+          if ((signed_word)descr >= 0) {
+            /* Descriptor is in the object.     */
             descr = *(word *)(current_p + descr - GC_DS_PER_OBJECT);
-         } else {
-           /* Descriptor is in type descriptor pointed to by first     */
-           /* word in object.                                          */
-           ptr_t type_descr = *(ptr_t *)current_p;
-           /* type_descr is either a valid pointer to the descriptor   */
-           /* structure, or this object was on a free list.  If it     */
-           /* it was anything but the last object on the free list,    */
-           /* we will misinterpret the next object on the free list as */
-           /* the type descriptor, and get a 0 GC descriptor, which    */
-           /* is ideal.  Unfortunately, we need to check for the last  */
-           /* object case explicitly.                                  */
-           if (0 == type_descr) {
-               /* Rarely executed.     */
-               mark_stack_top--;
-               continue;
-           }
+          } else {
+            /* Descriptor is in type descriptor pointed to by first     */
+            /* word in object.                                          */
+            ptr_t type_descr = *(ptr_t *)current_p;
+            /* type_descr is either a valid pointer to the descriptor   */
+            /* structure, or this object was on a free list.  If it     */
+            /* it was anything but the last object on the free list,    */
+            /* we will misinterpret the next object on the free list as */
+            /* the type descriptor, and get a 0 GC descriptor, which    */
+            /* is ideal.  Unfortunately, we need to check for the last  */
+            /* object case explicitly.                                  */
+            if (0 == type_descr) {
+                /* Rarely executed.     */
+                mark_stack_top--;
+                continue;
+            }
             descr = *(word *)(type_descr
-                             - (descr + (GC_INDIR_PER_OBJ_BIAS
-                                         - GC_DS_PER_OBJECT)));
-         }
-         if (0 == descr) {
-             /* Can happen either because we generated a 0 descriptor  */
-             /* or we saw a pointer to a free object.          */
-             mark_stack_top--;
-             continue;
-         }
+                              - (descr + (GC_INDIR_PER_OBJ_BIAS
+                                          - GC_DS_PER_OBJECT)));
+          }
+          if (0 == descr) {
+              /* Can happen either because we generated a 0 descriptor  */
+              /* or we saw a pointer to a free object.          */
+              mark_stack_top--;
+              continue;
+          }
           goto retry;
-       default:
-         /* Can't happen. */
-         limit = 0; /* initialized to prevent warning. */
+        default:
+          /* Can't happen. */
+          limit = 0; /* initialized to prevent warning. */
       }
     } else /* Small object with length descriptor */ {
       mark_stack_top--;
       limit = current_p + (word)descr;
     }
 #   ifdef ENABLE_TRACE
-       if (GC_trace_addr >= current_p
-           && GC_trace_addr < limit) {
-           GC_log_printf("GC:%u Tracing from %p len %lu\n",
-                         (int)GC_gc_no, current_p, (unsigned long) descr);
-       }
+        if (GC_trace_addr >= current_p
+            && GC_trace_addr < limit) {
+            GC_log_printf("GC:%u Tracing from %p len %lu\n",
+                          (int)GC_gc_no, current_p, (unsigned long) descr);
+        }
 #   endif /* ENABLE_TRACE */
-    /* The simple case in which we're scanning a range.        */
+    /* The simple case in which we're scanning a range. */
     GC_ASSERT(!((word)current_p & (ALIGNMENT-1)));
     credit -= limit - current_p;
     limit -= sizeof(word);
@@ -807,72 +805,72 @@ mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, mse *mark_stack_limit)
 #     ifndef SMALL_CONFIG
         word deferred;
 
-       /* Try to prefetch the next pointer to be examined asap.        */
-       /* Empirically, this also seems to help slightly without        */
-       /* prefetches, at least on linux/X86.  Presumably this loop     */
-       /* ends up with less register pressure, and gcc thus ends up    */
-       /* generating slightly better code.  Overall gcc code quality   */
-       /* for this loop is still not great.                            */
-       for(;;) {
-         PREFETCH(limit - PREF_DIST*CACHE_LINE_SIZE);
-         GC_ASSERT(limit >= current_p);
-         deferred = *(word *)limit;
-         FIXUP_POINTER(deferred);
-         limit -= ALIGNMENT;
-         if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <  greatest_ha) {
-           PREFETCH((ptr_t)deferred);
-           break;
-         }
-         if (current_p > limit) goto next_object;
-         /* Unroll once, so we don't do too many of the prefetches     */
-         /* based on limit.                                            */
-         deferred = *(word *)limit;
-         FIXUP_POINTER(deferred);
-         limit -= ALIGNMENT;
-         if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <  greatest_ha) {
-           PREFETCH((ptr_t)deferred);
-           break;
-         }
-         if (current_p > limit) goto next_object;
-       }
+        /* Try to prefetch the next pointer to be examined asap.        */
+        /* Empirically, this also seems to help slightly without        */
+        /* prefetches, at least on linux/X86.  Presumably this loop     */
+        /* ends up with less register pressure, and gcc thus ends up    */
+        /* generating slightly better code.  Overall gcc code quality   */
+        /* for this loop is still not great.                            */
+        for(;;) {
+          PREFETCH(limit - PREF_DIST*CACHE_LINE_SIZE);
+          GC_ASSERT(limit >= current_p);
+          deferred = *(word *)limit;
+          FIXUP_POINTER(deferred);
+          limit -= ALIGNMENT;
+          if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <  greatest_ha) {
+            PREFETCH((ptr_t)deferred);
+            break;
+          }
+          if (current_p > limit) goto next_object;
+          /* Unroll once, so we don't do too many of the prefetches     */
+          /* based on limit.                                            */
+          deferred = *(word *)limit;
+          FIXUP_POINTER(deferred);
+          limit -= ALIGNMENT;
+          if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <  greatest_ha) {
+            PREFETCH((ptr_t)deferred);
+            break;
+          }
+          if (current_p > limit) goto next_object;
+        }
 #     endif
 
       while (current_p <= limit) {
-       /* Empirically, unrolling this loop doesn't help a lot. */
-       /* Since PUSH_CONTENTS expands to a lot of code,        */
-       /* we don't.                                            */
+        /* Empirically, unrolling this loop doesn't help a lot. */
+        /* Since PUSH_CONTENTS expands to a lot of code,        */
+        /* we don't.                                            */
         current = *(word *)current_p;
-       FIXUP_POINTER(current);
+        FIXUP_POINTER(current);
         PREFETCH(current_p + PREF_DIST*CACHE_LINE_SIZE);
         if ((ptr_t)current >= least_ha && (ptr_t)current <  greatest_ha) {
-         /* Prefetch the contents of the object we just pushed.  It's  */
-         /* likely we will need them soon.                             */
-         PREFETCH((ptr_t)current);
+          /* Prefetch the contents of the object we just pushed.  It's  */
+          /* likely we will need them soon.                             */
+          PREFETCH((ptr_t)current);
 #         ifdef ENABLE_TRACE
-           if (GC_trace_addr == current_p) {
-               GC_log_printf("GC:%u Considering(1) %p -> %p\n",
-                             (unsigned)GC_gc_no, current_p, (ptr_t) current);
-           }
+            if (GC_trace_addr == current_p) {
+                GC_log_printf("GC:%u Considering(1) %p -> %p\n",
+                              (unsigned)GC_gc_no, current_p, (ptr_t) current);
+            }
 #         endif /* ENABLE_TRACE */
           PUSH_CONTENTS((ptr_t)current, mark_stack_top,
-                          mark_stack_limit, current_p, exit2);
+                           mark_stack_limit, current_p, exit2);
         }
         current_p += ALIGNMENT;
       }
 
 #     ifndef SMALL_CONFIG
-       /* We still need to mark the entry we previously prefetched.    */
-       /* We already know that it passes the preliminary pointer       */
-       /* validity test.                                               */
+        /* We still need to mark the entry we previously prefetched.    */
+        /* We already know that it passes the preliminary pointer       */
+        /* validity test.                                               */
 #       ifdef ENABLE_TRACE
-           if (GC_trace_addr == current_p) {
-               GC_log_printf("GC:%u Considering(2) %p -> %p\n",
-                             (unsigned)GC_gc_no, current_p, (ptr_t) deferred);
-           }
+            if (GC_trace_addr == current_p) {
+                GC_log_printf("GC:%u Considering(2) %p -> %p\n",
+                              (unsigned)GC_gc_no, current_p, (ptr_t) deferred);
+            }
 #       endif /* ENABLE_TRACE */
         PUSH_CONTENTS((ptr_t)deferred, mark_stack_top,
-                        mark_stack_limit, current_p, exit4);
-       next_object:;
+                         mark_stack_limit, current_p, exit4);
+        next_object:;
 #     endif
     }
   }
@@ -881,31 +879,31 @@ mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, mse *mark_stack_limit)
 
 #ifdef PARALLEL_MARK
 
-STATIC GC_bool GC_help_wanted = FALSE; /* Protected by mark lock       */
-STATIC unsigned GC_helper_count = 0;   /* Number of running helpers.   */
-                                       /* Protected by mark lock       */
-STATIC unsigned GC_active_count = 0;   /* Number of active helpers.    */
-                                       /* Protected by mark lock       */
-                                       /* May increase and decrease    */
-                                       /* within each mark cycle.  But */
-                                       /* once it returns to 0, it     */
-                                       /* stays zero for the cycle.    */
+STATIC GC_bool GC_help_wanted = FALSE;  /* Protected by mark lock       */
+STATIC unsigned GC_helper_count = 0;    /* Number of running helpers.   */
+                                        /* Protected by mark lock       */
+STATIC unsigned GC_active_count = 0;    /* Number of active helpers.    */
+                                        /* Protected by mark lock       */
+                                        /* May increase and decrease    */
+                                        /* within each mark cycle.  But */
+                                        /* once it returns to 0, it     */
+                                        /* stays zero for the cycle.    */
 
 word GC_mark_no = 0;
 
 #define LOCAL_MARK_STACK_SIZE HBLKSIZE
-       /* Under normal circumstances, this is big enough to guarantee  */
-       /* We don't overflow half of it in a single call to             */
-       /* GC_mark_from.                                                */
+        /* Under normal circumstances, this is big enough to guarantee  */
+        /* We don't overflow half of it in a single call to             */
+        /* GC_mark_from.                                                */
 
 
-/* Steal mark stack entries starting at mse low into mark stack local  */
-/* until we either steal mse high, or we have max entries.             */
-/* Return a pointer to the top of the local mark stack.                        */
-/* *next is replaced by a pointer to the next unscanned mark stack     */
-/* entry.                                                              */
+/* Steal mark stack entries starting at mse low into mark stack local   */
+/* until we either steal mse high, or we have max entries.              */
+/* Return a pointer to the top of the local mark stack.                 */
+/* *next is replaced by a pointer to the next unscanned mark stack      */
+/* entry.                                                               */
 STATIC mse * GC_steal_mark_stack(mse * low, mse * high, mse * local,
-                                unsigned max, mse **next)
+                                 unsigned max, mse **next)
 {
     mse *p;
     mse *top = local - 1;
@@ -913,30 +911,30 @@ STATIC mse * GC_steal_mark_stack(mse * low, mse * high, mse * local,
 
     GC_ASSERT(high >= low-1 && (word)(high - low + 1) <= GC_mark_stack_size);
     for (p = low; p <= high && i <= max; ++p) {
-       word descr = AO_load((volatile AO_t *) &(p -> mse_descr));
-       if (descr != 0) {
-           /* Must be ordered after read of descr: */
-           AO_store_release_write((volatile AO_t *) &(p -> mse_descr), 0);
-           /* More than one thread may get this entry, but that's only */
-           /* a minor performance problem.                             */
-           ++top;
-           top -> mse_descr = descr;
-           top -> mse_start = p -> mse_start;
-           GC_ASSERT((top -> mse_descr & GC_DS_TAGS) != GC_DS_LENGTH || 
-                     top -> mse_descr < (word)GC_greatest_plausible_heap_addr
-                                        - (word)GC_least_plausible_heap_addr);
-           /* If this is a big object, count it as                     */
-           /* size/256 + 1 objects.                                    */
-           ++i;
-           if ((descr & GC_DS_TAGS) == GC_DS_LENGTH) i += (int)(descr >> 8);
-       }
+        word descr = AO_load((volatile AO_t *) &(p -> mse_descr));
+        if (descr != 0) {
+            /* Must be ordered after read of descr: */
+            AO_store_release_write((volatile AO_t *) &(p -> mse_descr), 0);
+            /* More than one thread may get this entry, but that's only */
+            /* a minor performance problem.                             */
+            ++top;
+            top -> mse_descr = descr;
+            top -> mse_start = p -> mse_start;
+            GC_ASSERT((top -> mse_descr & GC_DS_TAGS) != GC_DS_LENGTH ||
+                      top -> mse_descr < (word)GC_greatest_plausible_heap_addr
+                                         - (word)GC_least_plausible_heap_addr);
+            /* If this is a big object, count it as                     */
+            /* size/256 + 1 objects.                                    */
+            ++i;
+            if ((descr & GC_DS_TAGS) == GC_DS_LENGTH) i += (int)(descr >> 8);
+        }
     }
     *next = p;
     return top;
 }
 
-/* Copy back a local mark stack.       */
-/* low and high are inclusive bounds.  */
+/* Copy back a local mark stack.        */
+/* low and high are inclusive bounds.   */
 STATIC void GC_return_mark_stack(mse * low, mse * high)
 {
     mse * my_top;
@@ -946,31 +944,31 @@ STATIC void GC_return_mark_stack(mse * low, mse * high)
     if (high < low) return;
     stack_size = high - low + 1;
     GC_acquire_mark_lock();
-    my_top = GC_mark_stack_top;        /* Concurrent modification impossible. */
+    my_top = GC_mark_stack_top; /* Concurrent modification impossible. */
     my_start = my_top + 1;
     if (my_start - GC_mark_stack + stack_size > GC_mark_stack_size) {
       if (GC_print_stats) {
-         GC_log_printf("No room to copy back mark stack\n");
+          GC_log_printf("No room to copy back mark stack\n");
       }
       GC_mark_state = MS_INVALID;
       GC_mark_stack_too_small = TRUE;
-      /* We drop the local mark stack.  We'll fix things later.        */
+      /* We drop the local mark stack.  We'll fix things later. */
     } else {
       BCOPY(low, my_start, stack_size * sizeof(mse));
       GC_ASSERT((mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))
-               == my_top);
+                == my_top);
       AO_store_release_write((volatile AO_t *)(&GC_mark_stack_top),
-                            (AO_t)(my_top + stack_size));
-               /* Ensures visibility of previously written stack contents. */
+                             (AO_t)(my_top + stack_size));
+                /* Ensures visibility of previously written stack contents. */
     }
     GC_release_mark_lock();
     GC_notify_all_marker();
 }
 
-/* Mark from the local mark stack.             */
-/* On return, the local mark stack is empty.   */
-/* But this may be achieved by copying the     */
-/* local mark stack back into the global one.  */
+/* Mark from the local mark stack.              */
+/* On return, the local mark stack is empty.    */
+/* But this may be achieved by copying the      */
+/* local mark stack back into the global one.   */
 STATIC void GC_do_local_mark(mse *local_mark_stack, mse *local_top)
 {
     unsigned n;
@@ -978,51 +976,51 @@ STATIC void GC_do_local_mark(mse *local_mark_stack, mse *local_top)
 
 #   ifdef GC_ASSERTIONS
       /* Make sure we don't hold mark lock. */
-       GC_acquire_mark_lock();
-       GC_release_mark_lock();
+        GC_acquire_mark_lock();
+        GC_release_mark_lock();
 #   endif
     for (;;) {
         for (n = 0; n < N_LOCAL_ITERS; ++n) {
-           local_top = GC_mark_from(local_top, local_mark_stack,
-                                    local_mark_stack + LOCAL_MARK_STACK_SIZE);
-           if (local_top < local_mark_stack) return;
-           if (local_top - local_mark_stack >= LOCAL_MARK_STACK_SIZE/2) {
-               GC_return_mark_stack(local_mark_stack, local_top);
-               return;
-           }
-       }
-       if ((mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))
-           < (mse *)AO_load(&GC_first_nonempty)
-           && GC_active_count < GC_helper_count
-           && local_top > local_mark_stack + 1) {
-           /* Try to share the load, since the main stack is empty,    */
-           /* and helper threads are waiting for a refill.             */
-           /* The entries near the bottom of the stack are likely      */
-           /* to require more work.  Thus we return those, eventhough  */
-           /* it's harder.                                             */
-           mse * new_bottom = local_mark_stack
-                               + (local_top - local_mark_stack)/2;
-           GC_ASSERT(new_bottom > local_mark_stack
-                     && new_bottom < local_top);
-           GC_return_mark_stack(local_mark_stack, new_bottom - 1);
-           memmove(local_mark_stack, new_bottom,
-                   (local_top - new_bottom + 1) * sizeof(mse));
-           local_top -= (new_bottom - local_mark_stack);
-       }
+            local_top = GC_mark_from(local_top, local_mark_stack,
+                                     local_mark_stack + LOCAL_MARK_STACK_SIZE);
+            if (local_top < local_mark_stack) return;
+            if (local_top - local_mark_stack >= LOCAL_MARK_STACK_SIZE/2) {
+                GC_return_mark_stack(local_mark_stack, local_top);
+                return;
+            }
+        }
+        if ((mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))
+            < (mse *)AO_load(&GC_first_nonempty)
+            && GC_active_count < GC_helper_count
+            && local_top > local_mark_stack + 1) {
+            /* Try to share the load, since the main stack is empty,    */
+            /* and helper threads are waiting for a refill.             */
+            /* The entries near the bottom of the stack are likely      */
+            /* to require more work.  Thus we return those, eventhough  */
+            /* it's harder.                                             */
+            mse * new_bottom = local_mark_stack
+                                + (local_top - local_mark_stack)/2;
+            GC_ASSERT(new_bottom > local_mark_stack
+                      && new_bottom < local_top);
+            GC_return_mark_stack(local_mark_stack, new_bottom - 1);
+            memmove(local_mark_stack, new_bottom,
+                    (local_top - new_bottom + 1) * sizeof(mse));
+            local_top -= (new_bottom - local_mark_stack);
+        }
     }
 }
 
 #define ENTRIES_TO_GET 5
 
-long GC_markers = 2;           /* Normally changed by thread-library-  */
-                               /* -specific code.                      */
+long GC_markers = 2;            /* Normally changed by thread-library-  */
+                                /* -specific code.                      */
 
-/* Mark using the local mark stack until the global mark stack is empty        */
-/* and there are no active workers. Update GC_first_nonempty to reflect        */
-/* progress.                                                           */
-/* Caller does not hold mark lock.                                     */
-/* Caller has already incremented GC_helper_count.  We decrement it,   */
-/* and maintain GC_active_count.                                       */
+/* Mark using the local mark stack until the global mark stack is empty */
+/* and there are no active workers. Update GC_first_nonempty to reflect */
+/* progress.                                                            */
+/* Caller does not hold mark lock.                                      */
+/* Caller has already incremented GC_helper_count.  We decrement it,    */
+/* and maintain GC_active_count.                                        */
 STATIC void GC_mark_local(mse *local_mark_stack, int id)
 {
     mse * my_first_nonempty;
@@ -1030,140 +1028,140 @@ STATIC void GC_mark_local(mse *local_mark_stack, int id)
     GC_acquire_mark_lock();
     GC_active_count++;
     my_first_nonempty = (mse *)AO_load(&GC_first_nonempty);
-    GC_ASSERT((mse *)AO_load(&GC_first_nonempty) >= GC_mark_stack && 
-             (mse *)AO_load(&GC_first_nonempty) <=
-             (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top)) + 1);
+    GC_ASSERT((mse *)AO_load(&GC_first_nonempty) >= GC_mark_stack &&
+              (mse *)AO_load(&GC_first_nonempty) <=
+              (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top)) + 1);
     if (GC_print_stats == VERBOSE)
-       GC_log_printf("Starting mark helper %lu\n", (unsigned long)id);
+        GC_log_printf("Starting mark helper %lu\n", (unsigned long)id);
     GC_release_mark_lock();
     for (;;) {
-       size_t n_on_stack;
+        size_t n_on_stack;
         unsigned n_to_get;
-       mse * my_top;
-       mse * local_top;
+        mse * my_top;
+        mse * local_top;
         mse * global_first_nonempty = (mse *)AO_load(&GC_first_nonempty);
 
-       GC_ASSERT(my_first_nonempty >= GC_mark_stack && 
-                 my_first_nonempty <=
-                 (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))  + 1);
-       GC_ASSERT(global_first_nonempty >= GC_mark_stack && 
-                 global_first_nonempty <= 
-                 (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))  + 1);
-       if (my_first_nonempty < global_first_nonempty) {
-           my_first_nonempty = global_first_nonempty;
+        GC_ASSERT(my_first_nonempty >= GC_mark_stack &&
+                  my_first_nonempty <=
+                  (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))  + 1);
+        GC_ASSERT(global_first_nonempty >= GC_mark_stack &&
+                  global_first_nonempty <=
+                  (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top))  + 1);
+        if (my_first_nonempty < global_first_nonempty) {
+            my_first_nonempty = global_first_nonempty;
         } else if (global_first_nonempty < my_first_nonempty) {
-           AO_compare_and_swap(&GC_first_nonempty, 
-                               (AO_t) global_first_nonempty,
-                               (AO_t) my_first_nonempty);
-           /* If this fails, we just go ahead, without updating        */
-           /* GC_first_nonempty.                                       */
-       }
-       /* Perhaps we should also update GC_first_nonempty, if it */
-       /* is less.  But that would require using atomic updates. */
-       my_top = (mse *)AO_load_acquire((volatile AO_t *)(&GC_mark_stack_top));
-       n_on_stack = my_top - my_first_nonempty + 1;
+            AO_compare_and_swap(&GC_first_nonempty,
+                                (AO_t) global_first_nonempty,
+                                (AO_t) my_first_nonempty);
+            /* If this fails, we just go ahead, without updating        */
+            /* GC_first_nonempty.                                       */
+        }
+        /* Perhaps we should also update GC_first_nonempty, if it */
+        /* is less.  But that would require using atomic updates. */
+        my_top = (mse *)AO_load_acquire((volatile AO_t *)(&GC_mark_stack_top));
+        n_on_stack = my_top - my_first_nonempty + 1;
         if (0 == n_on_stack) {
-           GC_acquire_mark_lock();
+            GC_acquire_mark_lock();
             my_top = GC_mark_stack_top;
-               /* Asynchronous modification impossible here,   */
-               /* since we hold mark lock.                     */
+                /* Asynchronous modification impossible here,   */
+                /* since we hold mark lock.                     */
             n_on_stack = my_top - my_first_nonempty + 1;
-           if (0 == n_on_stack) {
-               GC_active_count--;
-               GC_ASSERT(GC_active_count <= GC_helper_count);
-               /* Other markers may redeposit objects  */
-               /* on the stack.                                */
-               if (0 == GC_active_count) GC_notify_all_marker();
-               while (GC_active_count > 0
-                      && (mse *)AO_load(&GC_first_nonempty)
-                         > GC_mark_stack_top) {
-                   /* We will be notified if either GC_active_count    */
-                   /* reaches zero, or if more objects are pushed on   */
-                   /* the global mark stack.                           */
-                   GC_wait_marker();
-               }
-               if (GC_active_count == 0 &&
-                   (mse *)AO_load(&GC_first_nonempty) > GC_mark_stack_top) { 
-                   GC_bool need_to_notify = FALSE;
-                   /* The above conditions can't be falsified while we */
-                   /* hold the mark lock, since neither                */
-                   /* GC_active_count nor GC_mark_stack_top can        */
-                   /* change.  GC_first_nonempty can only be           */
-                   /* incremented asynchronously.  Thus we know that   */
-                   /* both conditions actually held simultaneously.    */
-                   GC_helper_count--;
-                   if (0 == GC_helper_count) need_to_notify = TRUE;
-                   if (GC_print_stats == VERBOSE)
-                     GC_log_printf(
-                       "Finished mark helper %lu\n", (unsigned long)id);
-                   GC_release_mark_lock();
-                   if (need_to_notify) GC_notify_all_marker();
-                   return;
-               }
-               /* else there's something on the stack again, or        */
-               /* another helper may push something.                   */
-               GC_active_count++;
-               GC_ASSERT(GC_active_count > 0);
-               GC_release_mark_lock();
-               continue;
-           } else {
-               GC_release_mark_lock();
-           }
-       }
-       n_to_get = ENTRIES_TO_GET;
-       if (n_on_stack < 2 * ENTRIES_TO_GET) n_to_get = 1;
-       local_top = GC_steal_mark_stack(my_first_nonempty, my_top,
-                                       local_mark_stack, n_to_get,
-                                       &my_first_nonempty);
-        GC_ASSERT(my_first_nonempty >= GC_mark_stack && 
-                 my_first_nonempty <=
-                   (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top)) + 1);
-       GC_do_local_mark(local_mark_stack, local_top);
+            if (0 == n_on_stack) {
+                GC_active_count--;
+                GC_ASSERT(GC_active_count <= GC_helper_count);
+                /* Other markers may redeposit objects  */
+                /* on the stack.                                */
+                if (0 == GC_active_count) GC_notify_all_marker();
+                while (GC_active_count > 0
+                       && (mse *)AO_load(&GC_first_nonempty)
+                          > GC_mark_stack_top) {
+                    /* We will be notified if either GC_active_count    */
+                    /* reaches zero, or if more objects are pushed on   */
+                    /* the global mark stack.                           */
+                    GC_wait_marker();
+                }
+                if (GC_active_count == 0 &&
+                    (mse *)AO_load(&GC_first_nonempty) > GC_mark_stack_top) {
+                    GC_bool need_to_notify = FALSE;
+                    /* The above conditions can't be falsified while we */
+                    /* hold the mark lock, since neither                */
+                    /* GC_active_count nor GC_mark_stack_top can        */
+                    /* change.  GC_first_nonempty can only be           */
+                    /* incremented asynchronously.  Thus we know that   */
+                    /* both conditions actually held simultaneously.    */
+                    GC_helper_count--;
+                    if (0 == GC_helper_count) need_to_notify = TRUE;
+                    if (GC_print_stats == VERBOSE)
+                      GC_log_printf(
+                        "Finished mark helper %lu\n", (unsigned long)id);
+                    GC_release_mark_lock();
+                    if (need_to_notify) GC_notify_all_marker();
+                    return;
+                }
+                /* else there's something on the stack again, or        */
+                /* another helper may push something.                   */
+                GC_active_count++;
+                GC_ASSERT(GC_active_count > 0);
+                GC_release_mark_lock();
+                continue;
+            } else {
+                GC_release_mark_lock();
+            }
+        }
+        n_to_get = ENTRIES_TO_GET;
+        if (n_on_stack < 2 * ENTRIES_TO_GET) n_to_get = 1;
+        local_top = GC_steal_mark_stack(my_first_nonempty, my_top,
+                                        local_mark_stack, n_to_get,
+                                        &my_first_nonempty);
+        GC_ASSERT(my_first_nonempty >= GC_mark_stack &&
+                  my_first_nonempty <=
+                    (mse *)AO_load((volatile AO_t *)(&GC_mark_stack_top)) + 1);
+        GC_do_local_mark(local_mark_stack, local_top);
     }
 }
 
-/* Perform Parallel mark.                      */
-/* We hold the GC lock, not the mark lock.     */
-/* Currently runs until the mark stack is      */
-/* empty.                                      */
+/* Perform Parallel mark.                       */
+/* We hold the GC lock, not the mark lock.      */
+/* Currently runs until the mark stack is       */
+/* empty.                                       */
 STATIC void GC_do_parallel_mark(void)
 {
     mse local_mark_stack[LOCAL_MARK_STACK_SIZE];
 
     GC_acquire_mark_lock();
     GC_ASSERT(I_HOLD_LOCK());
-    /* This could be a GC_ASSERT, but it seems safer to keep it on     */
-    /* all the time, especially since it's cheap.                      */
+    /* This could be a GC_ASSERT, but it seems safer to keep it on      */
+    /* all the time, especially since it's cheap.                       */
     if (GC_help_wanted || GC_active_count != 0 || GC_helper_count != 0)
-       ABORT("Tried to start parallel mark in bad state");
+        ABORT("Tried to start parallel mark in bad state");
     if (GC_print_stats == VERBOSE)
-       GC_log_printf("Starting marking for mark phase number %lu\n",
-                  (unsigned long)GC_mark_no);
+        GC_log_printf("Starting marking for mark phase number %lu\n",
+                   (unsigned long)GC_mark_no);
     GC_first_nonempty = (AO_t)GC_mark_stack;
     GC_active_count = 0;
     GC_helper_count = 1;
     GC_help_wanted = TRUE;
     GC_release_mark_lock();
     GC_notify_all_marker();
-       /* Wake up potential helpers.   */
+        /* Wake up potential helpers.   */
     GC_mark_local(local_mark_stack, 0);
     GC_acquire_mark_lock();
     GC_help_wanted = FALSE;
-    /* Done; clean up. */
+    /* Done; clean up.  */
     while (GC_helper_count > 0) GC_wait_marker();
     /* GC_helper_count cannot be incremented while GC_help_wanted == FALSE */
     if (GC_print_stats == VERBOSE)
-       GC_log_printf(
-           "Finished marking for mark phase number %lu\n",
-           (unsigned long)GC_mark_no);
+        GC_log_printf(
+            "Finished marking for mark phase number %lu\n",
+            (unsigned long)GC_mark_no);
     GC_mark_no++;
     GC_release_mark_lock();
     GC_notify_all_marker();
 }
 
 
-/* Try to help out the marker, if it's running.                */
-/* We do not hold the GC lock, but the requestor does. */
+/* Try to help out the marker, if it's running.         */
+/* We do not hold the GC lock, but the requestor does.  */
 void GC_help_marker(word my_mark_no)
 {
     mse local_mark_stack[LOCAL_MARK_STACK_SIZE];
@@ -1177,8 +1175,8 @@ void GC_help_marker(word my_mark_no)
     }
     my_id = GC_helper_count;
     if (GC_mark_no != my_mark_no || my_id >= (unsigned)GC_markers) {
-      /* Second test is useful only if original threads can also       */
-      /* act as helpers.  Under Linux they can't.                      */
+      /* Second test is useful only if original threads can also        */
+      /* act as helpers.  Under Linux they can't.                       */
       GC_release_mark_lock();
       return;
     }
@@ -1191,13 +1189,13 @@ void GC_help_marker(word my_mark_no)
 #endif /* PARALLEL_MARK */
 
 /* Allocate or reallocate space for mark stack of size n entries.  */
-/* May silently fail.                                             */
+/* May silently fail.                                              */
 static void alloc_mark_stack(size_t n)
 {
     mse * new_stack = (mse *)GC_scratch_alloc(n * sizeof(struct GC_ms_entry));
 #   ifdef GWW_VDB
-      /* Don't recycle a stack segment obtained with the wrong flags.  */
-      /* Win32 GetWriteWatch requires the right kind of memory.                */
+      /* Don't recycle a stack segment obtained with the wrong flags.   */
+      /* Win32 GetWriteWatch requires the right kind of memory.         */
       static GC_bool GC_incremental_at_stack_alloc = 0;
       GC_bool recycle_old = (!GC_incremental || GC_incremental_at_stack_alloc);
 
@@ -1205,35 +1203,35 @@ static void alloc_mark_stack(size_t n)
 #   else
 #     define recycle_old 1
 #   endif
-    
+
     GC_mark_stack_too_small = FALSE;
     if (GC_mark_stack_size != 0) {
         if (new_stack != 0) {
-         if (recycle_old) {
+          if (recycle_old) {
             /* Recycle old space */
               size_t page_offset = (word)GC_mark_stack & (GC_page_size - 1);
               size_t size = GC_mark_stack_size * sizeof(struct GC_ms_entry);
-             size_t displ = 0;
-          
-             if (0 != page_offset) displ = GC_page_size - page_offset;
-             size = (size - displ) & ~(GC_page_size - 1);
-             if (size > 0) {
-               GC_add_to_heap((struct hblk *)
-                               ((word)GC_mark_stack + displ), (word)size);
-             }
-         }
+              size_t displ = 0;
+
+              if (0 != page_offset) displ = GC_page_size - page_offset;
+              size = (size - displ) & ~(GC_page_size - 1);
+              if (size > 0) {
+                GC_add_to_heap((struct hblk *)
+                                ((word)GC_mark_stack + displ), (word)size);
+              }
+          }
           GC_mark_stack = new_stack;
           GC_mark_stack_size = n;
-         GC_mark_stack_limit = new_stack + n;
-         if (GC_print_stats) {
-             GC_log_printf("Grew mark stack to %lu frames\n",
-                           (unsigned long) GC_mark_stack_size);
-         }
+          GC_mark_stack_limit = new_stack + n;
+          if (GC_print_stats) {
+              GC_log_printf("Grew mark stack to %lu frames\n",
+                            (unsigned long) GC_mark_stack_size);
+          }
         } else {
-         if (GC_print_stats) {
-             GC_log_printf("Failed to grow mark stack to %lu frames\n",
-                           (unsigned long) n);
-         }
+          if (GC_print_stats) {
+              GC_log_printf("Failed to grow mark stack to %lu frames\n",
+                            (unsigned long) n);
+          }
         }
     } else {
         if (new_stack == 0) {
@@ -1242,7 +1240,7 @@ static void alloc_mark_stack(size_t n)
         }
         GC_mark_stack = new_stack;
         GC_mark_stack_size = n;
-       GC_mark_stack_limit = new_stack + n;
+        GC_mark_stack_limit = new_stack + n;
     }
     GC_mark_stack_top = GC_mark_stack-1;
 }
@@ -1262,18 +1260,18 @@ void GC_mark_init(void)
 void GC_push_all(ptr_t bottom, ptr_t top)
 {
     register word length;
-    
+
     bottom = (ptr_t)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
     top = (ptr_t)(((word) top) & ~(ALIGNMENT-1));
     if (top == 0 || bottom == top) return;
     GC_mark_stack_top++;
     if (GC_mark_stack_top >= GC_mark_stack_limit) {
-       ABORT("unexpected mark stack overflow");
+        ABORT("unexpected mark stack overflow");
     }
     length = top - bottom;
 #   if GC_DS_TAGS > ALIGNMENT - 1
-       length += GC_DS_TAGS;
-       length &= ~GC_DS_TAGS;
+        length += GC_DS_TAGS;
+        length &= ~GC_DS_TAGS;
 #   endif
     GC_mark_stack_top -> mse_start = bottom;
     GC_mark_stack_top -> mse_descr = length;
@@ -1290,8 +1288,8 @@ void GC_push_all(ptr_t bottom, ptr_t top)
  * in the event of a stack overflow.)
  */
 void GC_push_selected(ptr_t bottom, ptr_t top,
-                     int (*dirty_fn) (struct hblk *),
-                     void (*push_fn) (ptr_t, ptr_t))
+                      int (*dirty_fn) (struct hblk *),
+                      void (*push_fn) (ptr_t, ptr_t))
 {
     struct hblk * h;
 
@@ -1301,29 +1299,29 @@ void GC_push_selected(ptr_t bottom, ptr_t top,
     if (top == 0 || bottom == top) return;
     h = HBLKPTR(bottom + HBLKSIZE);
     if (top <= (ptr_t) h) {
-       if ((*dirty_fn)(h-1)) {
-           (*push_fn)(bottom, top);
-       }
-       return;
+        if ((*dirty_fn)(h-1)) {
+            (*push_fn)(bottom, top);
+        }
+        return;
     }
     if ((*dirty_fn)(h-1)) {
         (*push_fn)(bottom, (ptr_t)h);
     }
     while ((ptr_t)(h+1) <= top) {
-       if ((*dirty_fn)(h)) {
-           if ((word)(GC_mark_stack_top - GC_mark_stack)
-               > 3 * GC_mark_stack_size / 4) {
-               /* Danger of mark stack overflow */
-               (*push_fn)((ptr_t)h, top);
-               return;
-           } else {
-               (*push_fn)((ptr_t)h, (ptr_t)(h+1));
-           }
-       }
-       h++;
+        if ((*dirty_fn)(h)) {
+            if ((word)(GC_mark_stack_top - GC_mark_stack)
+                > 3 * GC_mark_stack_size / 4) {
+                /* Danger of mark stack overflow */
+                (*push_fn)((ptr_t)h, top);
+                return;
+            } else {
+                (*push_fn)((ptr_t)h, (ptr_t)(h+1));
+            }
+        }
+        h++;
     }
     if ((ptr_t)h != top) {
-       if ((*dirty_fn)(h)) {
+        if ((*dirty_fn)(h)) {
             (*push_fn)((ptr_t)h, top);
         }
     }
@@ -1338,17 +1336,17 @@ void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all)
 {
     if (all) {
       if (GC_dirty_maintained) {
-#      ifdef PROC_VDB
-           /* Pages that were never dirtied cannot contain pointers    */
-           GC_push_selected(bottom, top, GC_page_was_ever_dirty, GC_push_all);
-#      else
-           GC_push_all(bottom, top);
-#      endif
+#       ifdef PROC_VDB
+            /* Pages that were never dirtied cannot contain pointers    */
+            GC_push_selected(bottom, top, GC_page_was_ever_dirty, GC_push_all);
+#       else
+            GC_push_all(bottom, top);
+#       endif
       } else {
-       GC_push_all(bottom, top);
+        GC_push_all(bottom, top);
       }
     } else {
-       GC_push_selected(bottom, top, GC_page_was_dirty, GC_push_all);
+        GC_push_selected(bottom, top, GC_page_was_dirty, GC_push_all);
     }
 }
 #endif
@@ -1364,9 +1362,9 @@ void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all)
 
 /*ARGSUSED*/
 GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj,
-                                    mse *mark_stack_ptr,
-                                    mse *mark_stack_limit,
-                                    void **src)
+                                     mse *mark_stack_ptr,
+                                     mse *mark_stack_limit,
+                                     void **src)
 {
     hdr * hhdr;
 
@@ -1374,34 +1372,34 @@ GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj,
     GET_HDR(obj, hhdr);
     if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr),FALSE)) {
       if (GC_all_interior_pointers) {
-       hhdr = GC_find_header(GC_base(obj));
-       if (hhdr == 0) {
+        hhdr = GC_find_header(GC_base(obj));
+        if (hhdr == 0) {
           GC_ADD_TO_BLACK_LIST_NORMAL(obj, (ptr_t)src);
-         return mark_stack_ptr;
-       }
+          return mark_stack_ptr;
+        }
       } else {
         GC_ADD_TO_BLACK_LIST_NORMAL(obj, (ptr_t)src);
-       return mark_stack_ptr;
+        return mark_stack_ptr;
       }
     }
     if (EXPECT(HBLK_IS_FREE(hhdr),0)) {
-       GC_ADD_TO_BLACK_LIST_NORMAL(obj, (ptr_t)src);
-       return mark_stack_ptr;
+        GC_ADD_TO_BLACK_LIST_NORMAL(obj, (ptr_t)src);
+        return mark_stack_ptr;
     }
 
     PUSH_CONTENTS_HDR(obj, mark_stack_ptr /* modified */, mark_stack_limit,
-                     (ptr_t)src, was_marked, hhdr, TRUE);
+                      (ptr_t)src, was_marked, hhdr, TRUE);
  was_marked:
     return mark_stack_ptr;
 }
 
-/* Mark and push (i.e. gray) a single object p onto the main   */
-/* mark stack.  Consider p to be valid if it is an interior    */
-/* pointer.                                                    */
-/* The object p has passed a preliminary pointer validity      */
-/* test, but we do not definitely know whether it is valid.    */
-/* Mark bits are NOT atomically updated.  Thus this must be the        */
-/* only thread setting them.                                   */
+/* Mark and push (i.e. gray) a single object p onto the main    */
+/* mark stack.  Consider p to be valid if it is an interior     */
+/* pointer.                                                     */
+/* The object p has passed a preliminary pointer validity       */
+/* test, but we do not definitely know whether it is valid.     */
+/* Mark bits are NOT atomically updated.  Thus this must be the */
+/* only thread setting them.                                    */
 # if defined(PRINT_BLACK_LIST) || defined(KEEP_BACK_PTRS)
     void GC_mark_and_push_stack(ptr_t p, ptr_t source)
 # else
@@ -1409,37 +1407,37 @@ GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj,
 #   define source ((ptr_t)0)
 # endif
 {
-    hdr * hhdr; 
+    hdr * hhdr;
     ptr_t r = p;
-  
+
     PREFETCH(p);
     GET_HDR(p, hhdr);
     if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr),FALSE)) {
         if (hhdr != 0) {
           r = GC_base(p);
-         hhdr = HDR(r);
-       }
+          hhdr = HDR(r);
+        }
         if (hhdr == 0) {
             GC_ADD_TO_BLACK_LIST_STACK(p, source);
-           return;
-       }
+            return;
+        }
     }
     if (EXPECT(HBLK_IS_FREE(hhdr),0)) {
-       GC_ADD_TO_BLACK_LIST_NORMAL(p, source);
-       return;
+        GC_ADD_TO_BLACK_LIST_NORMAL(p, source);
+        return;
     }
 #   if defined(MANUAL_VDB) && defined(THREADS)
-      /* Pointer is on the stack.  We may have dirtied the object      */
-      /* it points to, but not yet have called GC_dirty();     */
-      GC_dirty(p);     /* Implicitly affects entire object.    */
+      /* Pointer is on the stack.  We may have dirtied the object       */
+      /* it points to, but not yet have called GC_dirty();      */
+      GC_dirty(p);      /* Implicitly affects entire object.    */
 #   endif
     PUSH_CONTENTS_HDR(r, GC_mark_stack_top, GC_mark_stack_limit,
-                     source, mark_and_push_exit, hhdr, FALSE);
+                      source, mark_and_push_exit, hhdr, FALSE);
   mark_and_push_exit: ;
-    /* We silently ignore pointers to near the end of a block, */
-    /* which is very mildly suboptimal.                                */
-    /* FIXME: We should probably add a header word to address  */
-    /* this.                                                   */
+    /* We silently ignore pointers to near the end of a block,  */
+    /* which is very mildly suboptimal.                         */
+    /* FIXME: We should probably add a header word to address   */
+    /* this.                                                    */
 }
 
 # ifdef TRACE_BUF
@@ -1471,16 +1469,16 @@ void GC_print_trace(word gc_no, GC_bool lock)
 {
     int i;
     struct trace_entry *p;
-    
+
     if (lock) LOCK();
     for (i = GC_trace_buf_ptr-1; i != GC_trace_buf_ptr; i--) {
-       if (i < 0) i = TRACE_ENTRIES-1;
-       p = GC_trace_buf + i;
-       if (p -> gc_no < gc_no || p -> kind == 0) return;
-       printf("Trace:%s (gc:%u,bytes:%lu) 0x%X, 0x%X\n",
-               p -> kind, (unsigned)p -> gc_no,
-               (unsigned long)p -> bytes_allocd,
-               (p -> arg1) ^ 0x80000000, (p -> arg2) ^ 0x80000000);
+        if (i < 0) i = TRACE_ENTRIES-1;
+        p = GC_trace_buf + i;
+        if (p -> gc_no < gc_no || p -> kind == 0) return;
+        printf("Trace:%s (gc:%u,bytes:%lu) 0x%X, 0x%X\n",
+                p -> kind, (unsigned)p -> gc_no,
+                (unsigned long)p -> bytes_allocd,
+                (p -> arg1) ^ 0x80000000, (p -> arg2) ^ 0x80000000);
     }
     printf("Trace incomplete\n");
     if (lock) UNLOCK();
@@ -1506,12 +1504,12 @@ void GC_push_all_eager(ptr_t bottom, ptr_t top)
 #   define GC_least_plausible_heap_addr least_ha
 
     if (top == 0) return;
-    /* check all pointers in range and push if they appear     */
-    /* to be valid.                                            */
+    /* check all pointers in range and push if they appear      */
+    /* to be valid.                                             */
       lim = t - 1 /* longword */;
       for (p = b; p <= lim; p = (word *)(((ptr_t)p) + ALIGNMENT)) {
-       q = *p;
-       GC_PUSH_ONE_STACK(q, p);
+        q = *p;
+        GC_PUSH_ONE_STACK(q, p);
       }
 #   undef GC_greatest_plausible_heap_addr
 #   undef GC_least_plausible_heap_addr
@@ -1535,32 +1533,32 @@ void GC_push_all_stack(ptr_t bottom, ptr_t top)
 # if GC_GRANULE_WORDS == 1
 #   define USE_PUSH_MARKED_ACCELERATORS
 #   define PUSH_GRANULE(q) \
-               { word qcontents = (q)[0]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)); }
+                { word qcontents = (q)[0]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)); }
 # elif GC_GRANULE_WORDS == 2
 #   define USE_PUSH_MARKED_ACCELERATORS
 #   define PUSH_GRANULE(q) \
-               { word qcontents = (q)[0]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)); \
-                 qcontents = (q)[1]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)+1); }
+                { word qcontents = (q)[0]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)); \
+                  qcontents = (q)[1]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)+1); }
 # elif GC_GRANULE_WORDS == 4
 #   define USE_PUSH_MARKED_ACCELERATORS
 #   define PUSH_GRANULE(q) \
-               { word qcontents = (q)[0]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)); \
-                 qcontents = (q)[1]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)+1); \
-                 qcontents = (q)[2]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)+2); \
-                 qcontents = (q)[3]; \
-                 GC_PUSH_ONE_HEAP(qcontents, (q)+3); }
+                { word qcontents = (q)[0]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)); \
+                  qcontents = (q)[1]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)+1); \
+                  qcontents = (q)[2]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)+2); \
+                  qcontents = (q)[3]; \
+                  GC_PUSH_ONE_HEAP(qcontents, (q)+3); }
 # endif
 #endif
 
 #ifdef USE_PUSH_MARKED_ACCELERATORS
 /* Push all objects reachable from marked objects in the given block */
-/* containing objects of size 1 granule.                            */
+/* containing objects of size 1 granule.                             */
 void GC_push_marked1(struct hblk *h, hdr *hhdr)
 {
     word * mark_word_addr = &(hhdr->hb_marks[0]);
@@ -1569,9 +1567,9 @@ void GC_push_marked1(struct hblk *h, hdr *hhdr)
     word *q;
     word mark_word;
 
-    /* Allow registers to be used for some frequently acccessed        */
-    /* global variables.  Otherwise aliasing issues are likely */
-    /* to prevent that.                                                */
+    /* Allow registers to be used for some frequently acccessed */
+    /* global variables.  Otherwise aliasing issues are likely  */
+    /* to prevent that.                                         */
     ptr_t greatest_ha = GC_greatest_plausible_heap_addr;
     ptr_t least_ha = GC_least_plausible_heap_addr;
     mse * mark_stack_top = GC_mark_stack_top;
@@ -1580,26 +1578,26 @@ void GC_push_marked1(struct hblk *h, hdr *hhdr)
 #   define GC_mark_stack_limit mark_stack_limit
 #   define GC_greatest_plausible_heap_addr greatest_ha
 #   define GC_least_plausible_heap_addr least_ha
-    
+
     p = (word *)(h->hb_body);
     plim = (word *)(((word)h) + HBLKSIZE);
 
     /* go through all words in block */
-       while( p < plim )  {
-           mark_word = *mark_word_addr++;
-           q = p;
-           while(mark_word != 0) {
-             if (mark_word & 1) {
-                 PUSH_GRANULE(q);
-             }
-             q += GC_GRANULE_WORDS;
-             mark_word >>= 1;
-           }
-           p += WORDSZ*GC_GRANULE_WORDS;
-       }
+        while( p < plim )  {
+            mark_word = *mark_word_addr++;
+            q = p;
+            while(mark_word != 0) {
+              if (mark_word & 1) {
+                  PUSH_GRANULE(q);
+              }
+              q += GC_GRANULE_WORDS;
+              mark_word >>= 1;
+            }
+            p += WORDSZ*GC_GRANULE_WORDS;
+        }
 
 #   undef GC_greatest_plausible_heap_addr
-#   undef GC_least_plausible_heap_addr        
+#   undef GC_least_plausible_heap_addr
 #   undef GC_mark_stack_top
 #   undef GC_mark_stack_limit
 
@@ -1610,7 +1608,7 @@ void GC_push_marked1(struct hblk *h, hdr *hhdr)
 #ifndef UNALIGNED_PTRS
 
 /* Push all objects reachable from marked objects in the given block */
-/* of size 2 (granules) objects.                                    */
+/* of size 2 (granules) objects.                                     */
 void GC_push_marked2(struct hblk *h, hdr *hhdr)
 {
     word * mark_word_addr = &(hhdr->hb_marks[0]);
@@ -1628,27 +1626,27 @@ void GC_push_marked2(struct hblk *h, hdr *hhdr)
 #   define GC_mark_stack_limit mark_stack_limit
 #   define GC_greatest_plausible_heap_addr greatest_ha
 #   define GC_least_plausible_heap_addr least_ha
-    
+
     p = (word *)(h->hb_body);
     plim = (word *)(((word)h) + HBLKSIZE);
 
     /* go through all words in block */
-       while( p < plim )  {
-           mark_word = *mark_word_addr++;
-           q = p;
-           while(mark_word != 0) {
-             if (mark_word & 1) {
-                 PUSH_GRANULE(q);
-                 PUSH_GRANULE(q + GC_GRANULE_WORDS);
-             }
-             q += 2 * GC_GRANULE_WORDS;
-             mark_word >>= 2;
-           }
-           p += WORDSZ*GC_GRANULE_WORDS;
-       }
+        while( p < plim )  {
+            mark_word = *mark_word_addr++;
+            q = p;
+            while(mark_word != 0) {
+              if (mark_word & 1) {
+                  PUSH_GRANULE(q);
+                  PUSH_GRANULE(q + GC_GRANULE_WORDS);
+              }
+              q += 2 * GC_GRANULE_WORDS;
+              mark_word >>= 2;
+            }
+            p += WORDSZ*GC_GRANULE_WORDS;
+        }
 
 #   undef GC_greatest_plausible_heap_addr
-#   undef GC_least_plausible_heap_addr        
+#   undef GC_least_plausible_heap_addr
 #   undef GC_mark_stack_top
 #   undef GC_mark_stack_limit
 
@@ -1657,7 +1655,7 @@ void GC_push_marked2(struct hblk *h, hdr *hhdr)
 
 # if GC_GRANULE_WORDS < 4
 /* Push all objects reachable from marked objects in the given block */
-/* of size 4 (granules) objects.                                    */
+/* of size 4 (granules) objects.                                     */
 /* There is a risk of mark stack overflow here.  But we handle that. */
 /* And only unmarked objects get pushed, so it's not very likely.    */
 void GC_push_marked4(struct hblk *h, hdr *hhdr)
@@ -1676,28 +1674,28 @@ void GC_push_marked4(struct hblk *h, hdr *hhdr)
 #   define GC_mark_stack_limit mark_stack_limit
 #   define GC_greatest_plausible_heap_addr greatest_ha
 #   define GC_least_plausible_heap_addr least_ha
-    
+
     p = (word *)(h->hb_body);
     plim = (word *)(((word)h) + HBLKSIZE);
 
     /* go through all words in block */
-       while( p < plim )  {
-           mark_word = *mark_word_addr++;
-           q = p;
-           while(mark_word != 0) {
-             if (mark_word & 1) {
-                 PUSH_GRANULE(q);
-                 PUSH_GRANULE(q + GC_GRANULE_WORDS);
-                 PUSH_GRANULE(q + 2*GC_GRANULE_WORDS);
-                 PUSH_GRANULE(q + 3*GC_GRANULE_WORDS);
-             }
-             q += 4 * GC_GRANULE_WORDS;
-             mark_word >>= 4;
-           }
-           p += WORDSZ*GC_GRANULE_WORDS;
-       }
+        while( p < plim )  {
+            mark_word = *mark_word_addr++;
+            q = p;
+            while(mark_word != 0) {
+              if (mark_word & 1) {
+                  PUSH_GRANULE(q);
+                  PUSH_GRANULE(q + GC_GRANULE_WORDS);
+                  PUSH_GRANULE(q + 2*GC_GRANULE_WORDS);
+                  PUSH_GRANULE(q + 3*GC_GRANULE_WORDS);
+              }
+              q += 4 * GC_GRANULE_WORDS;
+              mark_word >>= 4;
+            }
+            p += WORDSZ*GC_GRANULE_WORDS;
+        }
 #   undef GC_greatest_plausible_heap_addr
-#   undef GC_least_plausible_heap_addr        
+#   undef GC_least_plausible_heap_addr
 #   undef GC_mark_stack_top
 #   undef GC_mark_stack_limit
     GC_mark_stack_top = mark_stack_top;
@@ -1719,9 +1717,9 @@ void GC_push_marked(struct hblk *h, hdr *hhdr)
     ptr_t lim;
     mse * GC_mark_stack_top_reg;
     mse * mark_stack_limit = GC_mark_stack_limit;
-    
+
     /* Some quick shortcuts: */
-       if ((0 | GC_DS_LENGTH) == descr) return;
+        if ((0 | GC_DS_LENGTH) == descr) return;
         if (GC_block_empty(hhdr)/* nothing marked */) return;
     GC_n_rescuing_pages++;
     GC_objects_are_marked = TRUE;
@@ -1730,7 +1728,7 @@ void GC_push_marked(struct hblk *h, hdr *hhdr)
     } else {
         lim = (h + 1)->hb_body - sz;
     }
-    
+
     switch(BYTES_TO_GRANULES(sz)) {
 #   if defined(USE_PUSH_MARKED_ACCELERATORS)
      case 1:
@@ -1746,11 +1744,11 @@ void GC_push_marked(struct hblk *h, hdr *hhdr)
          break;
 #     endif
 #    endif
-#   endif       
+#   endif
      default:
       GC_mark_stack_top_reg = GC_mark_stack_top;
       for (p = h -> hb_body, bit_no = 0; p <= lim;
-          p += sz, bit_no += MARK_BIT_OFFSET(sz)) {
+           p += sz, bit_no += MARK_BIT_OFFSET(sz)) {
          if (mark_bit_from_hdr(hhdr, bit_no)) {
            /* Mark from fields inside the object */
              PUSH_OBJ(p, hhdr, GC_mark_stack_top_reg, mark_stack_limit);
@@ -1761,15 +1759,15 @@ void GC_push_marked(struct hblk *h, hdr *hhdr)
 }
 
 #ifndef SMALL_CONFIG
-/* Test whether any page in the given block is dirty   */
+/* Test whether any page in the given block is dirty    */
 STATIC GC_bool GC_block_was_dirty(struct hblk *h, hdr *hhdr)
 {
     size_t sz = hhdr -> hb_sz;
-    
+
     if (sz <= MAXOBJBYTES) {
          return(GC_page_was_dirty(h));
     } else {
-        ptr_t p = (ptr_t)h;
+         ptr_t p = (ptr_t)h;
          while (p < (ptr_t)h + sz) {
              if (GC_page_was_dirty((struct hblk *)p)) return(TRUE);
              p += HBLKSIZE;
@@ -1779,12 +1777,12 @@ STATIC GC_bool GC_block_was_dirty(struct hblk *h, hdr *hhdr)
 }
 #endif /* SMALL_CONFIG */
 
-/* Similar to GC_push_marked, but skip over unallocated blocks */
-/* and return address of next plausible block.                 */
+/* Similar to GC_push_marked, but skip over unallocated blocks  */
+/* and return address of next plausible block.                  */
 struct hblk * GC_push_next_marked(struct hblk *h)
 {
     hdr * hhdr = HDR(h);
-    
+
     if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr) || HBLK_IS_FREE(hhdr), FALSE)) {
       h = GC_next_used_block(h);
       if (h == 0) return(0);
@@ -1795,20 +1793,20 @@ struct hblk * GC_push_next_marked(struct hblk *h)
 }
 
 #ifndef SMALL_CONFIG
-/* Identical to above, but mark only from dirty pages  */
+/* Identical to above, but mark only from dirty pages   */
 struct hblk * GC_push_next_marked_dirty(struct hblk *h)
 {
     hdr * hhdr = HDR(h);
-    
+
     if (!GC_dirty_maintained) { ABORT("dirty bits not set up"); }
     for (;;) {
-       if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr)
-                  || HBLK_IS_FREE(hhdr), FALSE)) {
+        if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr)
+                   || HBLK_IS_FREE(hhdr), FALSE)) {
           h = GC_next_used_block(h);
           if (h == 0) return(0);
           hhdr = GC_find_header((ptr_t)h);
-       }
-#      ifdef STUBBORN_ALLOC
+        }
+#       ifdef STUBBORN_ALLOC
           if (hhdr -> hb_obj_kind == STUBBORN) {
             if (GC_page_was_changed(h) && GC_block_was_dirty(h, hhdr)) {
                 break;
@@ -1816,35 +1814,34 @@ struct hblk * GC_push_next_marked_dirty(struct hblk *h)
           } else {
             if (GC_block_was_dirty(h, hhdr)) break;
           }
-#      else
-         if (GC_block_was_dirty(h, hhdr)) break;
-#      endif
+#       else
+          if (GC_block_was_dirty(h, hhdr)) break;
+#       endif
         h += OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz);
-       hhdr = HDR(h);
+        hhdr = HDR(h);
     }
     GC_push_marked(h, hhdr);
     return(h + OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz));
 }
 #endif
 
-/* Similar to above, but for uncollectable pages.  Needed since we     */
-/* do not clear marks for such pages, even for full collections.       */
+/* Similar to above, but for uncollectable pages.  Needed since we      */
+/* do not clear marks for such pages, even for full collections.        */
 struct hblk * GC_push_next_marked_uncollectable(struct hblk *h)
 {
     hdr * hhdr = HDR(h);
-    
+
     for (;;) {
-       if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr)
-                  || HBLK_IS_FREE(hhdr), FALSE)) {
+        if (EXPECT(IS_FORWARDING_ADDR_OR_NIL(hhdr)
+                   || HBLK_IS_FREE(hhdr), FALSE)) {
           h = GC_next_used_block(h);
           if (h == 0) return(0);
           hhdr = GC_find_header((ptr_t)h);
-       }
-       if (hhdr -> hb_obj_kind == UNCOLLECTABLE) break;
+        }
+        if (hhdr -> hb_obj_kind == UNCOLLECTABLE) break;
         h += OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz);
-       hhdr = HDR(h);
+        hhdr = HDR(h);
     }
     GC_push_marked(h, hhdr);
     return(h + OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz));
 }
-
index 16cfce8..4b30a71 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  *
 # include <stdio.h>
 # include "private/gc_priv.h"
 
-/* Data structure for list of root sets.                               */
-/* We keep a hash table, so that we can filter out duplicate additions.        */
-/* Under Win32, we need to do a better job of filtering overlaps, so   */
-/* we resort to sequential search, and pay the price.                  */
+/* Data structure for list of root sets.                                */
+/* We keep a hash table, so that we can filter out duplicate additions. */
+/* Under Win32, we need to do a better job of filtering overlaps, so    */
+/* we resort to sequential search, and pay the price.                   */
 /* This is really declared in gc_priv.h:
 struct roots {
-       ptr_t r_start;
-       ptr_t r_end;
- #     if !defined(MSWIN32) && !defined(MSWINCE)
-         struct roots * r_next;
- #     endif
-       GC_bool r_tmp;
-               -- Delete before registering new dynamic libraries
+        ptr_t r_start;
+        ptr_t r_end;
+ #      if !defined(MSWIN32) && !defined(MSWINCE)
+          struct roots * r_next;
+ #      endif
+        GC_bool r_tmp;
+                -- Delete before registering new dynamic libraries
 };
 
 struct roots GC_static_roots[MAX_ROOT_SETS];
 */
 
-int GC_no_dls = 0;     /* Register dynamic library data segments.      */
+int GC_no_dls = 0;      /* Register dynamic library data segments.      */
 
 static int n_root_sets = 0;
 
-       /* GC_static_roots[0..n_root_sets) contains the valid root sets. */
+        /* GC_static_roots[0..n_root_sets) contains the valid root sets. */
 
 # if !defined(NO_DEBUGGING)
-/* For debugging:      */
+/* For debugging:       */
 void GC_print_static_roots(void)
 {
     register int i;
     size_t total = 0;
-    
+
     for (i = 0; i < n_root_sets; i++) {
         GC_printf("From %p to %p%s\n",
-                 GC_static_roots[i].r_start,
-                 GC_static_roots[i].r_end,
-                 GC_static_roots[i].r_tmp ? " (temporary)" : "");
+                  GC_static_roots[i].r_start,
+                  GC_static_roots[i].r_end,
+                  GC_static_roots[i].r_tmp ? " (temporary)" : "");
         total += GC_static_roots[i].r_end - GC_static_roots[i].r_start;
     }
     GC_printf("Total size: %ld\n", (unsigned long) total);
     if (GC_root_size != total) {
-       GC_printf("GC_root_size incorrect: %ld!!\n",
-                 (unsigned long) GC_root_size);
+        GC_printf("GC_root_size incorrect: %ld!!\n",
+                  (unsigned long) GC_root_size);
     }
 }
 # endif /* NO_DEBUGGING */
 
-/* Primarily for debugging support:    */
-/* Is the address p in one of the registered static                    */
-/* root sections?                                                      */
+/* Primarily for debugging support:     */
+/* Is the address p in one of the registered static                     */
+/* root sections?                                                       */
 GC_bool GC_is_static_root(ptr_t p)
 {
     static int last_root_set = MAX_ROOT_SETS;
     register int i;
-    
-    
+
+
     if (last_root_set < n_root_sets
-       && p >= GC_static_roots[last_root_set].r_start
+        && p >= GC_static_roots[last_root_set].r_start
         && p < GC_static_roots[last_root_set].r_end) return(TRUE);
     for (i = 0; i < n_root_sets; i++) {
-       if (p >= GC_static_roots[i].r_start
+        if (p >= GC_static_roots[i].r_start
             && p < GC_static_roots[i].r_end) {
             last_root_set = i;
             return(TRUE);
@@ -83,24 +83,24 @@ GC_bool GC_is_static_root(ptr_t p)
 }
 
 #if !defined(MSWIN32) && !defined(MSWINCE)
-/* 
+/*
 #   define LOG_RT_SIZE 6
 #   define RT_SIZE (1 << LOG_RT_SIZE)  -- Power of 2, may be != MAX_ROOT_SETS
 
     struct roots * GC_root_index[RT_SIZE];
-       -- Hash table header.  Used only to check whether a range is
-       -- already present.
-       -- really defined in gc_priv.h
+        -- Hash table header.  Used only to check whether a range is
+        -- already present.
+        -- really defined in gc_priv.h
 */
 
 static INLINE int rt_hash(ptr_t addr)
 {
     word result = (word) addr;
 #   if CPP_WORDSZ > 8*LOG_RT_SIZE
-       result ^= result >> 8*LOG_RT_SIZE;
+        result ^= result >> 8*LOG_RT_SIZE;
 #   endif
 #   if CPP_WORDSZ > 4*LOG_RT_SIZE
-       result ^= result >> 4*LOG_RT_SIZE;
+        result ^= result >> 4*LOG_RT_SIZE;
 #   endif
     result ^= result >> 2*LOG_RT_SIZE;
     result ^= result >> LOG_RT_SIZE;
@@ -108,13 +108,13 @@ static INLINE int rt_hash(ptr_t addr)
     return(result);
 }
 
-/* Is a range starting at b already in the table? If so return a       */
-/* pointer to it, else NIL.                                            */
+/* Is a range starting at b already in the table? If so return a        */
+/* pointer to it, else NIL.                                             */
 struct roots * GC_roots_present(ptr_t b)
 {
     int h = rt_hash(b);
     struct roots *p = GC_root_index[h];
-    
+
     while (p != 0) {
         if (p -> r_start == (ptr_t)b) return(p);
         p = p -> r_next;
@@ -126,7 +126,7 @@ struct roots * GC_roots_present(ptr_t b)
 static void add_roots_to_index(struct roots *p)
 {
     int h = rt_hash(p -> r_start);
-    
+
     p -> r_next = GC_root_index[h];
     GC_root_index[h] = p;
 }
@@ -141,7 +141,7 @@ word GC_root_size = 0;
 GC_API void GC_CALL GC_add_roots(void *b, void *e)
 {
     DCL_LOCK_STATE;
-    
+
     if (!GC_is_initialized) GC_init();
     LOCK();
     GC_add_roots_inner((ptr_t)b, (ptr_t)e, FALSE);
@@ -149,12 +149,12 @@ GC_API void GC_CALL GC_add_roots(void *b, void *e)
 }
 
 
-/* Add [b,e) to the root set.  Adding the same interval a second time  */
-/* is a moderately fast no-op, and hence benign.  We do not handle     */
-/* different but overlapping intervals efficiently.  (We do handle     */
-/* them correctly.)                                                    */
-/* Tmp specifies that the interval may be deleted before               */
-/* re-registering dynamic libraries.                                   */ 
+/* Add [b,e) to the root set.  Adding the same interval a second time   */
+/* is a moderately fast no-op, and hence benign.  We do not handle      */
+/* different but overlapping intervals efficiently.  (We do handle      */
+/* them correctly.)                                                     */
+/* Tmp specifies that the interval may be deleted before                */
+/* re-registering dynamic libraries.                                    */
 void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp)
 {
     struct roots * old;
@@ -164,14 +164,14 @@ void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp)
     e = (ptr_t)((word)e & ~(sizeof(word) - 1));
     GC_ASSERT(b <= e);
     if (b == e) return;  /* nothing to do? */
-    
+
 #   if defined(MSWIN32) || defined(MSWINCE)
-      /* Spend the time to ensure that there are no overlapping        */
-      /* or adjacent intervals.                                        */
-      /* This could be done faster with e.g. a                 */
-      /* balanced tree.  But the execution time here is                */
-      /* virtually guaranteed to be dominated by the time it   */
-      /* takes to scan the roots.                              */
+      /* Spend the time to ensure that there are no overlapping */
+      /* or adjacent intervals.                                 */
+      /* This could be done faster with e.g. a                  */
+      /* balanced tree.  But the execution time here is         */
+      /* virtually guaranteed to be dominated by the time it    */
+      /* takes to scan the roots.                               */
       {
         register int i;
         old = 0; /* initialized to prevent warning. */
@@ -193,7 +193,7 @@ void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp)
         if (i < n_root_sets) {
           /* merge other overlapping intervals */
             struct roots *other;
-            
+
             for (i++; i < n_root_sets; i++) {
               other = GC_static_roots + i;
               b = other -> r_start;
@@ -247,7 +247,7 @@ static GC_bool roots_were_cleared = FALSE;
 GC_API void GC_CALL GC_clear_roots (void)
 {
     DCL_LOCK_STATE;
-    
+
     if (!GC_is_initialized) GC_init();
     LOCK();
     roots_were_cleared = TRUE;
@@ -255,16 +255,16 @@ GC_API void GC_CALL GC_clear_roots (void)
     GC_root_size = 0;
 #   if !defined(MSWIN32) && !defined(MSWINCE)
     {
-       register int i;
-       
-       for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0;
+        register int i;
+
+        for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0;
     }
 #   endif
     UNLOCK();
 }
 
-/* Internal use only; lock held.       */
-static void GC_remove_root_at_pos(int i) 
+/* Internal use only; lock held.        */
+static void GC_remove_root_at_pos(int i)
 {
     GC_root_size -= (GC_static_roots[i].r_end - GC_static_roots[i].r_start);
     GC_static_roots[i].r_start = GC_static_roots[n_root_sets-1].r_start;
@@ -277,26 +277,26 @@ static void GC_remove_root_at_pos(int i)
 static void GC_rebuild_root_index(void)
 {
     int i;
-       
+
     for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0;
     for (i = 0; i < n_root_sets; i++)
-       add_roots_to_index(GC_static_roots + i);
+        add_roots_to_index(GC_static_roots + i);
 }
 #endif
 
 #if defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \
      || defined(PCR)
-/* Internal use only; lock held.       */
+/* Internal use only; lock held.        */
 STATIC void GC_remove_tmp_roots(void)
 {
     int i;
-    
+
     for (i = 0; i < n_root_sets; ) {
-       if (GC_static_roots[i].r_tmp) {
+        if (GC_static_roots[i].r_tmp) {
             GC_remove_root_at_pos(i);
-       } else {
-           i++;
-       }
+        } else {
+            i++;
+        }
     }
 #   if !defined(MSWIN32) && !defined(MSWINCE)
       GC_rebuild_root_index();
@@ -313,9 +313,9 @@ GC_API void GC_CALL GC_remove_roots(void *b, void *e)
 
     /* Quick check whether has nothing to do */
     if ((((word)b + (sizeof(word) - 1)) & ~(sizeof(word) - 1)) >=
-       ((word)e & ~(sizeof(word) - 1)))
+        ((word)e & ~(sizeof(word) - 1)))
       return;
-    
+
     LOCK();
     GC_remove_roots_inner((ptr_t)b, (ptr_t)e);
     UNLOCK();
@@ -326,31 +326,31 @@ STATIC void GC_remove_roots_inner(ptr_t b, ptr_t e)
 {
     int i;
     for (i = 0; i < n_root_sets; ) {
-       if (GC_static_roots[i].r_start >= b
-           && GC_static_roots[i].r_end <= e) {
+        if (GC_static_roots[i].r_start >= b
+            && GC_static_roots[i].r_end <= e) {
             GC_remove_root_at_pos(i);
-       } else {
-           i++;
-       }
+        } else {
+            i++;
+        }
     }
     GC_rebuild_root_index();
 }
 #endif /* !defined(MSWIN32) && !defined(MSWINCE) */
 
 #if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION)
-/* Workaround for the OS mapping and unmapping behind our back:                */
-/* Is the address p in one of the temporary static root sections?      */
+/* Workaround for the OS mapping and unmapping behind our back:         */
+/* Is the address p in one of the temporary static root sections?       */
 GC_bool GC_is_tmp_root(ptr_t p)
 {
     static int last_root_set = MAX_ROOT_SETS;
     register int i;
-    
+
     if (last_root_set < n_root_sets
-       && p >= GC_static_roots[last_root_set].r_start
+        && p >= GC_static_roots[last_root_set].r_start
         && p < GC_static_roots[last_root_set].r_end)
-       return GC_static_roots[last_root_set].r_tmp;
+        return GC_static_roots[last_root_set].r_tmp;
     for (i = 0; i < n_root_sets; i++) {
-       if (p >= GC_static_roots[i].r_start
+        if (p >= GC_static_roots[i].r_start
             && p < GC_static_roots[i].r_end) {
             last_root_set = i;
             return GC_static_roots[i].r_tmp;
@@ -364,9 +364,9 @@ ptr_t GC_approx_sp(void)
 {
     volatile word sp;
     sp = (word)&sp;
-               /* Also force stack to grow if necessary. Otherwise the */
-               /* later accesses might cause the kernel to think we're */
-               /* doing something wrong.                               */
+                /* Also force stack to grow if necessary. Otherwise the */
+                /* later accesses might cause the kernel to think we're */
+                /* doing something wrong.                               */
 
     return((ptr_t)sp);
 }
@@ -381,15 +381,15 @@ struct exclusion {
 };
 
 struct exclusion GC_excl_table[MAX_EXCLUSIONS];
-                                       -- Array of exclusions, ascending
-                                       -- address order.
+                                        -- Array of exclusions, ascending
+                                        -- address order.
 */
 
-STATIC size_t GC_excl_table_entries = 0;/* Number of entries in use.     */
+STATIC size_t GC_excl_table_entries = 0;/* Number of entries in use.      */
 
 /* Return the first exclusion range that includes an address >= start_addr */
-/* Assumes the exclusion table contains at least one entry (namely the    */
-/* GC data structures).                                                           */
+/* Assumes the exclusion table contains at least one entry (namely the     */
+/* GC data structures).                                                    */
 STATIC struct exclusion * GC_next_exclusion(ptr_t start_addr)
 {
     size_t low = 0;
@@ -397,20 +397,20 @@ STATIC struct exclusion * GC_next_exclusion(ptr_t start_addr)
     size_t mid;
 
     while (high > low) {
-       mid = (low + high) >> 1;
-       /* low <= mid < high    */
-       if ((word) GC_excl_table[mid].e_end <= (word) start_addr) {
-           low = mid + 1;
-       } else {
-           high = mid;
-       }
+        mid = (low + high) >> 1;
+        /* low <= mid < high    */
+        if ((word) GC_excl_table[mid].e_end <= (word) start_addr) {
+            low = mid + 1;
+        } else {
+            high = mid;
+        }
     }
     if ((word) GC_excl_table[low].e_end <= (word) start_addr) return 0;
     return GC_excl_table + low;
 }
 
-/* Should only be called when the lock is held.  The range boundaries  */
-/* should be properly aligned and valid.                               */
+/* Should only be called when the lock is held.  The range boundaries   */
+/* should be properly aligned and valid.                                */
 void GC_exclude_static_roots_inner(void *start, void *finish)
 {
     struct exclusion * next;
@@ -420,23 +420,23 @@ void GC_exclude_static_roots_inner(void *start, void *finish)
     GC_ASSERT(start < finish);
 
     if (0 == GC_excl_table_entries) {
-       next = 0;
+        next = 0;
     } else {
-       next = GC_next_exclusion(start);
+        next = GC_next_exclusion(start);
     }
     if (0 != next) {
       if ((word)(next -> e_start) < (word) finish) {
-       /* incomplete error check. */
-       ABORT("exclusion ranges overlap");
-      }  
+        /* incomplete error check. */
+        ABORT("exclusion ranges overlap");
+      }
       if ((word)(next -> e_start) == (word) finish) {
-        /* extend old range backwards  */
+        /* extend old range backwards   */
           next -> e_start = (ptr_t)start;
-         return;
+          return;
       }
       next_index = next - GC_excl_table;
       for (i = GC_excl_table_entries; i > next_index; --i) {
-       GC_excl_table[i] = GC_excl_table[i-1];
+        GC_excl_table[i] = GC_excl_table[i-1];
       }
     } else {
       next_index = GC_excl_table_entries;
@@ -464,43 +464,43 @@ GC_API void GC_CALL GC_exclude_static_roots(void *b, void *e)
 /* Invoke push_conditional on ranges that are not excluded. */
 /*ARGSUSED*/
 STATIC void GC_push_conditional_with_exclusions(ptr_t bottom, ptr_t top,
-                                               GC_bool all)
+                                                GC_bool all)
 {
     struct exclusion * next;
     ptr_t excl_start;
 
     while (bottom < top) {
         next = GC_next_exclusion(bottom);
-       if (0 == next || (excl_start = next -> e_start) >= top) {
-           GC_push_conditional(bottom, top, all);
-           return;
-       }
-       if (excl_start > bottom) GC_push_conditional(bottom, excl_start, all);
-       bottom = next -> e_end;
+        if (0 == next || (excl_start = next -> e_start) >= top) {
+            GC_push_conditional(bottom, top, all);
+            return;
+        }
+        if (excl_start > bottom) GC_push_conditional(bottom, excl_start, all);
+        bottom = next -> e_end;
     }
 }
 
 #ifdef IA64
 /* Similar to GC_push_all_stack_frames() but for IA-64 registers store. */
 void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi, int eager,
-                       struct GC_activation_frame_s *activation_frame)
+                        struct GC_activation_frame_s *activation_frame)
 {
     while (activation_frame != NULL) {
-       ptr_t frame_bs_lo = activation_frame -> backing_store_end;
-       GC_ASSERT(frame_bs_lo <= bs_hi);
-       if (eager) {
-           GC_push_all_eager(frame_bs_lo, bs_hi);
-       } else {
-           GC_push_all_stack(frame_bs_lo, bs_hi);
-       }
-       bs_hi = activation_frame -> saved_backing_store_ptr;
-       activation_frame = activation_frame -> prev;
+        ptr_t frame_bs_lo = activation_frame -> backing_store_end;
+        GC_ASSERT(frame_bs_lo <= bs_hi);
+        if (eager) {
+            GC_push_all_eager(frame_bs_lo, bs_hi);
+        } else {
+            GC_push_all_stack(frame_bs_lo, bs_hi);
+        }
+        bs_hi = activation_frame -> saved_backing_store_ptr;
+        activation_frame = activation_frame -> prev;
     }
     GC_ASSERT(bs_lo <= bs_hi);
     if (eager) {
-       GC_push_all_eager(bs_lo, bs_hi);
+        GC_push_all_eager(bs_lo, bs_hi);
     } else {
-       GC_push_all_stack(bs_lo, bs_hi);
+        GC_push_all_stack(bs_lo, bs_hi);
     }
 }
 #endif /* IA64 */
@@ -508,39 +508,39 @@ void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi, int eager,
 #ifdef THREADS
 
 void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
-                       struct GC_activation_frame_s *activation_frame)
+                        struct GC_activation_frame_s *activation_frame)
 {
     while (activation_frame != NULL) {
-       GC_ASSERT(lo HOTTER_THAN (ptr_t)activation_frame);
-#      ifdef STACK_GROWS_UP
-           GC_push_all_stack((ptr_t)activation_frame, lo);
-#      else /* STACK_GROWS_DOWN */
-           GC_push_all_stack(lo, (ptr_t)activation_frame);
-#      endif
-       lo = activation_frame -> saved_stack_ptr;
-       GC_ASSERT(lo != NULL);
-       activation_frame = activation_frame -> prev;
+        GC_ASSERT(lo HOTTER_THAN (ptr_t)activation_frame);
+#       ifdef STACK_GROWS_UP
+            GC_push_all_stack((ptr_t)activation_frame, lo);
+#       else /* STACK_GROWS_DOWN */
+            GC_push_all_stack(lo, (ptr_t)activation_frame);
+#       endif
+        lo = activation_frame -> saved_stack_ptr;
+        GC_ASSERT(lo != NULL);
+        activation_frame = activation_frame -> prev;
     }
     GC_ASSERT(!(hi HOTTER_THAN lo));
 #   ifdef STACK_GROWS_UP
-       /* We got them backwards! */
-       GC_push_all_stack(hi, lo);
+        /* We got them backwards! */
+        GC_push_all_stack(hi, lo);
 #   else /* STACK_GROWS_DOWN */
-       GC_push_all_stack(lo, hi);
+        GC_push_all_stack(lo, hi);
 #   endif
 }
 
 #else /* !THREADS */
 
 # ifdef TRACE_BUF
-    /* Defined in mark.c.      */
+    /* Defined in mark.c.       */
     void GC_add_trace_entry(char *kind, word arg1, word arg2);
 # endif
 
-                       /* Similar to GC_push_all_eager, but only the   */
-                       /* part hotter than cold_gc_frame is scanned    */
-                       /* immediately.  Needed to ensure that callee-  */
-                       /* save registers are not missed.               */
+                        /* Similar to GC_push_all_eager, but only the   */
+                        /* part hotter than cold_gc_frame is scanned    */
+                        /* immediately.  Needed to ensure that callee-  */
+                        /* save registers are not missed.               */
 /*
  * A version of GC_push_all that treats all interior pointers as valid
  * and scans part of the area immediately, to make sure that saved
@@ -553,23 +553,23 @@ void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
  * GC_dirty() call.
  */
 STATIC void GC_push_all_stack_partially_eager(ptr_t bottom, ptr_t top,
-                                               ptr_t cold_gc_frame)
+                                                ptr_t cold_gc_frame)
 {
   if (!NEED_FIXUP_POINTER && GC_all_interior_pointers) {
     /* Push the hot end of the stack eagerly, so that register values   */
-    /* saved inside GC frames are marked before they disappear.                */
-    /* The rest of the marking can be deferred until later.            */
+    /* saved inside GC frames are marked before they disappear.         */
+    /* The rest of the marking can be deferred until later.             */
     if (0 == cold_gc_frame) {
-       GC_push_all_stack(bottom, top);
-       return;
+        GC_push_all_stack(bottom, top);
+        return;
     }
     GC_ASSERT(bottom <= cold_gc_frame && cold_gc_frame <= top);
 #   ifdef STACK_GROWS_DOWN
-       GC_push_all(cold_gc_frame - sizeof(ptr_t), top);
-       GC_push_all_eager(bottom, cold_gc_frame);
+        GC_push_all(cold_gc_frame - sizeof(ptr_t), top);
+        GC_push_all_eager(bottom, cold_gc_frame);
 #   else /* STACK_GROWS_UP */
-       GC_push_all(bottom, cold_gc_frame + sizeof(ptr_t));
-       GC_push_all_eager(cold_gc_frame, top);
+        GC_push_all(bottom, cold_gc_frame + sizeof(ptr_t));
+        GC_push_all_eager(cold_gc_frame, top);
 #   endif /* STACK_GROWS_UP */
   } else {
     GC_push_all_eager(bottom, top);
@@ -579,53 +579,53 @@ STATIC void GC_push_all_stack_partially_eager(ptr_t bottom, ptr_t top,
 # endif
 }
 
-/* Similar to GC_push_all_stack_frames() but also uses cold_gc_frame.  */
+/* Similar to GC_push_all_stack_frames() but also uses cold_gc_frame.   */
 STATIC void GC_push_all_stack_part_eager_frames(ptr_t lo, ptr_t hi,
-       ptr_t cold_gc_frame, struct GC_activation_frame_s *activation_frame)
+        ptr_t cold_gc_frame, struct GC_activation_frame_s *activation_frame)
 {
     GC_ASSERT(activation_frame == NULL || cold_gc_frame == NULL ||
-               cold_gc_frame HOTTER_THAN (ptr_t)activation_frame);
+                cold_gc_frame HOTTER_THAN (ptr_t)activation_frame);
 
     while (activation_frame != NULL) {
-       GC_ASSERT(lo HOTTER_THAN (ptr_t)activation_frame);
-#      ifdef STACK_GROWS_UP
-           GC_push_all_stack_partially_eager((ptr_t)activation_frame, lo,
-                                               cold_gc_frame);
-#      else /* STACK_GROWS_DOWN */
-           GC_push_all_stack_partially_eager(lo, (ptr_t)activation_frame,
-                                               cold_gc_frame);
-#      endif
-       lo = activation_frame -> saved_stack_ptr;
-       GC_ASSERT(lo != NULL);
-       activation_frame = activation_frame -> prev;
-       cold_gc_frame = NULL; /* Use at most once.      */
+        GC_ASSERT(lo HOTTER_THAN (ptr_t)activation_frame);
+#       ifdef STACK_GROWS_UP
+            GC_push_all_stack_partially_eager((ptr_t)activation_frame, lo,
+                                                cold_gc_frame);
+#       else /* STACK_GROWS_DOWN */
+            GC_push_all_stack_partially_eager(lo, (ptr_t)activation_frame,
+                                                cold_gc_frame);
+#       endif
+        lo = activation_frame -> saved_stack_ptr;
+        GC_ASSERT(lo != NULL);
+        activation_frame = activation_frame -> prev;
+        cold_gc_frame = NULL; /* Use at most once.      */
     }
 
     GC_ASSERT(!(hi HOTTER_THAN lo));
 #   ifdef STACK_GROWS_UP
-       /* We got them backwards! */
-       GC_push_all_stack_partially_eager(hi, lo, cold_gc_frame);
+        /* We got them backwards! */
+        GC_push_all_stack_partially_eager(hi, lo, cold_gc_frame);
 #   else /* STACK_GROWS_DOWN */
-       GC_push_all_stack_partially_eager(lo, hi, cold_gc_frame);
+        GC_push_all_stack_partially_eager(lo, hi, cold_gc_frame);
 #   endif
 }
 
 # ifdef IA64
     extern word GC_save_regs_ret_val;
-                       /* Previously set to backing store pointer.     */
+                        /* Previously set to backing store pointer.     */
 # endif
 
 #endif /* !THREADS */
 
-                       /* Push enough of the current stack eagerly to  */
-                       /* ensure that callee-save registers saved in   */
-                       /* GC frames are scanned.                       */
-                       /* In the non-threads case, schedule entire     */
-                       /* stack for scanning.                          */
-                       /* The second argument is a pointer to the      */
-                       /* (possibly null) thread context, for          */
-                       /* (currently hypothetical) more precise        */
-                       /* stack scanning.                              */
+                        /* Push enough of the current stack eagerly to  */
+                        /* ensure that callee-save registers saved in   */
+                        /* GC frames are scanned.                       */
+                        /* In the non-threads case, schedule entire     */
+                        /* stack for scanning.                          */
+                        /* The second argument is a pointer to the      */
+                        /* (possibly null) thread context, for          */
+                        /* (currently hypothetical) more precise        */
+                        /* stack scanning.                              */
 /*
  * In the absence of threads, push the stack contents.
  * In the presence of threads, push enough of the current stack
@@ -637,54 +637,54 @@ STATIC void GC_push_all_stack_part_eager_frames(ptr_t lo, ptr_t hi,
 STATIC void GC_push_current_stack(ptr_t cold_gc_frame, void * context)
 {
 #   if defined(THREADS)
-       if (0 == cold_gc_frame) return;
+        if (0 == cold_gc_frame) return;
 #       ifdef STACK_GROWS_DOWN
-         GC_push_all_eager(GC_approx_sp(), cold_gc_frame);
-         /* For IA64, the register stack backing store is handled      */
-         /* in the thread-specific code.                               */
+          GC_push_all_eager(GC_approx_sp(), cold_gc_frame);
+          /* For IA64, the register stack backing store is handled      */
+          /* in the thread-specific code.                               */
 #       else
-         GC_push_all_eager( cold_gc_frame, GC_approx_sp() );
+          GC_push_all_eager( cold_gc_frame, GC_approx_sp() );
 #       endif
 #   else
-       GC_push_all_stack_part_eager_frames(GC_approx_sp(), GC_stackbottom,
-                                       cold_gc_frame, GC_activation_frame);
-#      ifdef IA64
-             /* We also need to push the register stack backing store. */
-             /* This should really be done in the same way as the      */
-             /* regular stack.  For now we fudge it a bit.             */
-             /* Note that the backing store grows up, so we can't use  */
-             /* GC_push_all_stack_partially_eager.                     */
-             {
-               ptr_t bsp = (ptr_t) GC_save_regs_ret_val;
-               ptr_t cold_gc_bs_pointer = bsp - 2048;
-               if (GC_all_interior_pointers &&
-                   cold_gc_bs_pointer > BACKING_STORE_BASE) {
-                 /* Adjust cold_gc_bs_pointer if below our innermost   */
-                 /* "activation frame" in backing store.               */
-                 if (GC_activation_frame != NULL && cold_gc_bs_pointer <
-                               GC_activation_frame->backing_store_end)
-                   cold_gc_bs_pointer = GC_activation_frame->backing_store_end;
-                 GC_push_all_register_frames(BACKING_STORE_BASE,
-                       cold_gc_bs_pointer, FALSE, GC_activation_frame);
-                 GC_push_all_eager(cold_gc_bs_pointer, bsp);
-               } else {
-                 GC_push_all_register_frames(BACKING_STORE_BASE, bsp,
-                               TRUE /* eager */, GC_activation_frame);
-               }
-               /* All values should be sufficiently aligned that we    */
-               /* dont have to worry about the boundary.               */
-             }
+        GC_push_all_stack_part_eager_frames(GC_approx_sp(), GC_stackbottom,
+                                        cold_gc_frame, GC_activation_frame);
+#       ifdef IA64
+              /* We also need to push the register stack backing store. */
+              /* This should really be done in the same way as the      */
+              /* regular stack.  For now we fudge it a bit.             */
+              /* Note that the backing store grows up, so we can't use  */
+              /* GC_push_all_stack_partially_eager.                     */
+              {
+                ptr_t bsp = (ptr_t) GC_save_regs_ret_val;
+                ptr_t cold_gc_bs_pointer = bsp - 2048;
+                if (GC_all_interior_pointers &&
+                    cold_gc_bs_pointer > BACKING_STORE_BASE) {
+                  /* Adjust cold_gc_bs_pointer if below our innermost   */
+                  /* "activation frame" in backing store.               */
+                  if (GC_activation_frame != NULL && cold_gc_bs_pointer <
+                                GC_activation_frame->backing_store_end)
+                    cold_gc_bs_pointer = GC_activation_frame->backing_store_end;
+                  GC_push_all_register_frames(BACKING_STORE_BASE,
+                        cold_gc_bs_pointer, FALSE, GC_activation_frame);
+                  GC_push_all_eager(cold_gc_bs_pointer, bsp);
+                } else {
+                  GC_push_all_register_frames(BACKING_STORE_BASE, bsp,
+                                TRUE /* eager */, GC_activation_frame);
+                }
+                /* All values should be sufficiently aligned that we    */
+                /* dont have to worry about the boundary.               */
+              }
 #       endif
 #   endif /* !THREADS */
 }
 
 void (*GC_push_typed_structures) (void) = NULL;
 
-                       /* Push GC internal roots.  These are normally  */
-                       /* included in the static data segment, and     */
-                       /* Thus implicitly pushed.  But we must do this */
-                       /* explicitly if normal root processing is      */
-                       /* disabled.                                    */
+                        /* Push GC internal roots.  These are normally  */
+                        /* included in the static data segment, and     */
+                        /* Thus implicitly pushed.  But we must do this */
+                        /* explicitly if normal root processing is      */
+                        /* disabled.                                    */
 /*
  * Push GC internal roots.  Only called if there is some reason to believe
  * these would not otherwise get registered.
@@ -737,11 +737,11 @@ void GC_push_roots(GC_bool all, ptr_t cold_gc_frame)
      * Next push static data.  This must happen early on, since it's
      * not robust against mark stack overflow.
      */
-     /* Re-register dynamic libraries, in case one got added.          */
-     /* There is some argument for doing this as late as possible,     */
-     /* especially on win32, where it can change asynchronously.       */
-     /* In those cases, we do it here.  But on other platforms, it's   */
-     /* not safe with the world stopped, so we do it earlier.          */
+     /* Re-register dynamic libraries, in case one got added.           */
+     /* There is some argument for doing this as late as possible,      */
+     /* especially on win32, where it can change asynchronously.        */
+     /* In those cases, we do it here.  But on other platforms, it's    */
+     /* not safe with the world stopped, so we do it earlier.           */
 #      if !defined(REGISTER_LIBRARIES_EARLY)
          GC_cond_register_dynamic_libraries();
 #      endif
@@ -749,33 +749,33 @@ void GC_push_roots(GC_bool all, ptr_t cold_gc_frame)
      /* Mark everything in static data areas                             */
        for (i = 0; i < n_root_sets; i++) {
          GC_push_conditional_with_exclusions(
-                            GC_static_roots[i].r_start,
-                            GC_static_roots[i].r_end, all);
+                             GC_static_roots[i].r_start,
+                             GC_static_roots[i].r_end, all);
        }
 
-     /* Mark all free list header blocks, if those were allocated from */
-     /* the garbage collected heap.  This makes sure they don't        */
-     /* disappear if we are not marking from static data.  It also     */
-     /* saves us the trouble of scanning them, and possibly that of    */
-     /* marking the freelists.                                         */
+     /* Mark all free list header blocks, if those were allocated from  */
+     /* the garbage collected heap.  This makes sure they don't         */
+     /* disappear if we are not marking from static data.  It also      */
+     /* saves us the trouble of scanning them, and possibly that of     */
+     /* marking the freelists.                                          */
        for (kind = 0; kind < GC_n_kinds; kind++) {
-        void *base = GC_base(GC_obj_kinds[kind].ok_freelist);
-        if (0 != base) {
-          GC_set_mark_bit(base);
-        }
+         void *base = GC_base(GC_obj_kinds[kind].ok_freelist);
+         if (0 != base) {
+           GC_set_mark_bit(base);
+         }
        }
-       
-     /* Mark from GC internal roots if those might otherwise have      */
-     /* been excluded.                                                 */
+
+     /* Mark from GC internal roots if those might otherwise have       */
+     /* been excluded.                                                  */
        if (GC_no_dls || roots_were_cleared) {
-          GC_push_gc_structures();
+           GC_push_gc_structures();
        }
 
-     /* Mark thread local free lists, even if their mark       */
-     /* descriptor excludes the link field.                    */
-     /* If the world is not stopped, this is unsafe.  It is    */
-     /* also unnecessary, since we will do this again with the */
-     /* world stopped.                                         */
+     /* Mark thread local free lists, even if their mark        */
+     /* descriptor excludes the link field.                     */
+     /* If the world is not stopped, this is unsafe.  It is     */
+     /* also unnecessary, since we will do this again with the  */
+     /* world stopped.                                          */
 #      if defined(THREAD_LOCAL_ALLOC)
          if (GC_world_stopped) GC_mark_thread_local_free_lists();
 #      endif
@@ -790,9 +790,8 @@ void GC_push_roots(GC_bool all, ptr_t cold_gc_frame)
       GC_push_regs_and_stack(cold_gc_frame);
 
     if (GC_push_other_roots != 0) (*GC_push_other_roots)();
-       /* In the threads case, this also pushes thread stacks. */
-        /* Note that without interior pointer recognition lots */
-       /* of stuff may have been pushed already, and this      */
-       /* should be careful about mark stack overflows.        */
+        /* In the threads case, this also pushes thread stacks. */
+        /* Note that without interior pointer recognition lots  */
+        /* of stuff may have been pushed already, and this      */
+        /* should be careful about mark stack overflows.        */
 }
-
index e50a13e..694a381 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
+ * Copyright (c) 1996 by Silicon Graphics.  All rights reserved.
+ * Copyright (c) 1998 by Fergus Henderson.  All rights reserved.
+ * Copyright (c) 2000-2009 by Hewlett-Packard Development Company.
+ * All rights reserved.
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose,  provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
 #include "private/pthread_support.h"
 
 #if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) && \
@@ -29,7 +46,7 @@ void GC_print_sig_mask(void)
     int i;
 
     if (pthread_sigmask(SIG_BLOCK, NULL, &blocked) != 0)
-       ABORT("pthread_sigmask");
+        ABORT("pthread_sigmask");
     GC_printf("Blocked: ");
     for (i = 1; i < NSIG; i++) {
         if (sigismember(&blocked, i)) { GC_printf("%d ", i); }
@@ -39,25 +56,25 @@ void GC_print_sig_mask(void)
 
 #endif
 
-/* Remove the signals that we want to allow in thread stopping         */
-/* handler from a set.                                         */
+/* Remove the signals that we want to allow in thread stopping  */
+/* handler from a set.                                          */
 STATIC void GC_remove_allowed_signals(sigset_t *set)
 {
     if (sigdelset(set, SIGINT) != 0
-         || sigdelset(set, SIGQUIT) != 0
-         || sigdelset(set, SIGABRT) != 0
-         || sigdelset(set, SIGTERM) != 0) {
+          || sigdelset(set, SIGQUIT) != 0
+          || sigdelset(set, SIGABRT) != 0
+          || sigdelset(set, SIGTERM) != 0) {
         ABORT("sigdelset() failed");
     }
 
 #   ifdef MPROTECT_VDB
-      /* Handlers write to the thread structure, which is in the heap, */
-      /* and hence can trigger a protection fault.                     */
+      /* Handlers write to the thread structure, which is in the heap,  */
+      /* and hence can trigger a protection fault.                      */
       if (sigdelset(set, SIGSEGV) != 0
-#        ifdef SIGBUS
-           || sigdelset(set, SIGBUS) != 0
-#        endif
-         ) {
+#         ifdef SIGBUS
+            || sigdelset(set, SIGBUS) != 0
+#         endif
+          ) {
         ABORT("sigdelset() failed");
       }
 #   endif
@@ -66,13 +83,13 @@ STATIC void GC_remove_allowed_signals(sigset_t *set)
 static sigset_t suspend_handler_mask;
 
 volatile AO_t GC_stop_count;
-                       /* Incremented at the beginning of GC_stop_world. */
+                        /* Incremented at the beginning of GC_stop_world. */
 
 volatile AO_t GC_world_is_stopped = FALSE;
-                       /* FALSE ==> it is safe for threads to restart, i.e. */
-                       /* they will see another suspend signal before they  */
-                       /* are expected to stop (unless they have voluntarily */
-                       /* stopped).                                         */
+                        /* FALSE ==> it is safe for threads to restart, i.e. */
+                        /* they will see another suspend signal before they  */
+                        /* are expected to stop (unless they have voluntarily */
+                        /* stopped).                                         */
 
 #ifdef GC_OSF1_THREADS
   STATIC GC_bool GC_retry_signals = TRUE;
@@ -82,7 +99,7 @@ volatile AO_t GC_world_is_stopped = FALSE;
 
 /*
  * We use signals to stop threads during GC.
- * 
+ *
  * Suspended threads wait in signal handler for SIG_THR_RESTART.
  * That's more portable than semaphores or condition variables.
  * (We do use sem_post from a signal handler, but that should be portable.)
@@ -108,8 +125,8 @@ STATIC sem_t GC_suspend_ack_sem;
 
 #ifdef GC_NETBSD_THREADS
 # define GC_NETBSD_THREADS_WORKAROUND
-  /* It seems to be necessary to wait until threads have restarted.    */
-  /* But it is unclear why that is the case.                           */
+  /* It seems to be necessary to wait until threads have restarted.     */
+  /* But it is unclear why that is the case.                            */
   STATIC sem_t GC_restart_ack_sem;
 #endif
 
@@ -128,8 +145,8 @@ STATIC void GC_suspend_handler(int sig)
   errno = old_errno;
 }
 #else
-/* We believe that in all other cases the full context is already      */
-/* in the signal handler frame.                                                */
+/* We believe that in all other cases the full context is already       */
+/* in the signal handler frame.                                         */
 #ifdef SA_SIGINFO
 STATIC void GC_suspend_handler(int sig, siginfo_t *info, void *context)
 #else
@@ -163,52 +180,52 @@ STATIC void GC_suspend_handler_inner(ptr_t sig_arg, void *context)
 
     me = GC_lookup_thread(my_thread);
     /* The lookup here is safe, since I'm doing this on behalf  */
-    /* of a thread which holds the allocation lock in order    */
-    /* to stop the world.  Thus concurrent modification of the */
-    /* data structure is impossible.                           */
+    /* of a thread which holds the allocation lock in order     */
+    /* to stop the world.  Thus concurrent modification of the  */
+    /* data structure is impossible.                            */
     if (me -> stop_info.last_stop_count == my_stop_count) {
-       /* Duplicate signal.  OK if we are retrying.    */
-       if (!GC_retry_signals) {
-           WARN("Duplicate suspend signal in thread %p\n", pthread_self());
-       }
-       return;
+        /* Duplicate signal.  OK if we are retrying.    */
+        if (!GC_retry_signals) {
+            WARN("Duplicate suspend signal in thread %p\n", pthread_self());
+        }
+        return;
     }
 #   ifdef SPARC
-       me -> stop_info.stack_ptr = GC_save_regs_in_stack();
+        me -> stop_info.stack_ptr = GC_save_regs_in_stack();
 #   else
-       me -> stop_info.stack_ptr = (ptr_t)(&dummy);
+        me -> stop_info.stack_ptr = (ptr_t)(&dummy);
 #   endif
 #   ifdef IA64
-       me -> backing_store_ptr = GC_save_regs_in_stack();
+        me -> backing_store_ptr = GC_save_regs_in_stack();
 #   endif
 
     /* Tell the thread that wants to stop the world that this   */
-    /* thread has been stopped.  Note that sem_post() is       */
+    /* thread has been stopped.  Note that sem_post() is        */
     /* the only async-signal-safe primitive in LinuxThreads.    */
     sem_post(&GC_suspend_ack_sem);
     me -> stop_info.last_stop_count = my_stop_count;
 
     /* Wait until that thread tells us to restart by sending    */
-    /* this thread a SIG_THR_RESTART signal.                   */
-    /* SIG_THR_RESTART should be masked at this point.  Thus there     */
-    /* is no race.                                             */
-    /* We do not continue until we receive a SIG_THR_RESTART,  */
-    /* but we do not take that as authoritative.  (We may be   */
-    /* accidentally restarted by one of the user signals we    */
-    /* don't block.)  After we receive the signal, we use a    */
-    /* primitive and expensive mechanism to wait until it's    */
-    /* really safe to proceed.  Under normal circumstances,    */
-    /* this code should not be executed.                       */
+    /* this thread a SIG_THR_RESTART signal.                    */
+    /* SIG_THR_RESTART should be masked at this point.  Thus there      */
+    /* is no race.                                              */
+    /* We do not continue until we receive a SIG_THR_RESTART,   */
+    /* but we do not take that as authoritative.  (We may be    */
+    /* accidentally restarted by one of the user signals we     */
+    /* don't block.)  After we receive the signal, we use a     */
+    /* primitive and expensive mechanism to wait until it's     */
+    /* really safe to proceed.  Under normal circumstances,     */
+    /* this code should not be executed.                        */
     do {
-       sigsuspend (&suspend_handler_mask);
+        sigsuspend (&suspend_handler_mask);
     } while (AO_load_acquire(&GC_world_is_stopped)
-            && AO_load(&GC_stop_count) == my_stop_count);
+             && AO_load(&GC_stop_count) == my_stop_count);
     /* If the RESTART signal gets lost, we can still lose.  That should be  */
     /* less likely than losing the SUSPEND signal, since we don't do much   */
-    /* between the sem_post and sigsuspend.                                */
-    /* We'd need more handshaking to work around that.                     */
+    /* between the sem_post and sigsuspend.                                 */
+    /* We'd need more handshaking to work around that.                      */
     /* Simply dropping the sigsuspend call should be safe, but is unlikely  */
-    /* to be efficient.                                                            */
+    /* to be efficient.                                                     */
 
 #   if DEBUG_THREADS
       GC_printf("Continuing 0x%x\n", (unsigned)my_thread);
@@ -243,8 +260,8 @@ void GC_thr_init(void);
 # else
 #   define IF_IA64(x)
 # endif
-/* We hold allocation lock.  Should do exactly the right thing if the  */
-/* world is stopped.  Should not fail if it isn't.                     */
+/* We hold allocation lock.  Should do exactly the right thing if the   */
+/* world is stopped.  Should not fail if it isn't.                      */
 void GC_push_all_stacks(void)
 {
     GC_bool found_me = FALSE;
@@ -255,7 +272,7 @@ void GC_push_all_stacks(void)
     /* On IA64, we also need to scan the register backing store. */
     IF_IA64(ptr_t bs_lo; ptr_t bs_hi;)
     pthread_t me = pthread_self();
-    
+
     if (!GC_thr_initialized) GC_thr_init();
 #   if DEBUG_THREADS
         GC_printf("Pushing stacks from thread 0x%x\n", (unsigned) me);
@@ -263,48 +280,48 @@ void GC_push_all_stacks(void)
     for (i = 0; i < THREAD_TABLE_SZ; i++) {
       for (p = GC_threads[i]; p != 0; p = p -> next) {
         if (p -> flags & FINISHED) continue;
-       ++nthreads;
+        ++nthreads;
         if (THREAD_EQUAL(p -> id, me)) {
-           GC_ASSERT(!p->thread_blocked);
-#          ifdef SPARC
-               lo = (ptr_t)GC_save_regs_in_stack();
-#          else
-               lo = GC_approx_sp();
+            GC_ASSERT(!p->thread_blocked);
+#           ifdef SPARC
+                lo = (ptr_t)GC_save_regs_in_stack();
+#           else
+                lo = GC_approx_sp();
 #           endif
-           found_me = TRUE;
-           IF_IA64(bs_hi = (ptr_t)GC_save_regs_in_stack();)
-       } else {
-           lo = p -> stop_info.stack_ptr;
-           IF_IA64(bs_hi = p -> backing_store_ptr;)
-       }
+            found_me = TRUE;
+            IF_IA64(bs_hi = (ptr_t)GC_save_regs_in_stack();)
+        } else {
+            lo = p -> stop_info.stack_ptr;
+            IF_IA64(bs_hi = p -> backing_store_ptr;)
+        }
         if ((p -> flags & MAIN_THREAD) == 0) {
-           hi = p -> stack_end;
-           IF_IA64(bs_lo = p -> backing_store_end);
+            hi = p -> stack_end;
+            IF_IA64(bs_lo = p -> backing_store_end);
         } else {
             /* The original stack. */
             hi = GC_stackbottom;
-           IF_IA64(bs_lo = BACKING_STORE_BASE;)
+            IF_IA64(bs_lo = BACKING_STORE_BASE;)
         }
-#      if DEBUG_THREADS
+#       if DEBUG_THREADS
             GC_printf("Stack for thread 0x%x = [%p,%p)\n",
-                     (unsigned)(p -> id), lo, hi);
-#      endif
-       if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
-       GC_push_all_stack_frames(lo, hi, p -> activation_frame);
-#      ifdef IA64
+                      (unsigned)(p -> id), lo, hi);
+#       endif
+        if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
+        GC_push_all_stack_frames(lo, hi, p -> activation_frame);
+#       ifdef IA64
 #         if DEBUG_THREADS
             GC_printf("Reg stack for thread 0x%x = [%p,%p)\n",
-                     (unsigned)p -> id, bs_lo, bs_hi);
-#        endif
-         /* FIXME:  This (if p->id==me) may add an unbounded number of */
-         /* entries, and hence overflow the mark stack, which is bad.  */
-         GC_push_all_register_frames(bs_lo, bs_hi,
-                       THREAD_EQUAL(p -> id, me), p -> activation_frame);
-#      endif
+                      (unsigned)p -> id, bs_lo, bs_hi);
+#         endif
+          /* FIXME:  This (if p->id==me) may add an unbounded number of */
+          /* entries, and hence overflow the mark stack, which is bad.  */
+          GC_push_all_register_frames(bs_lo, bs_hi,
+                        THREAD_EQUAL(p -> id, me), p -> activation_frame);
+#       endif
       }
     }
     if (GC_print_stats == VERBOSE) {
-       GC_log_printf("Pushed %d thread stacks\n", (int)nthreads);
+        GC_log_printf("Pushed %d thread stacks\n", (int)nthreads);
     }
     if (!found_me && !GC_in_thread_creation)
       ABORT("Collecting from unknown thread.");
@@ -317,8 +334,8 @@ pthread_t GC_stopping_thread;
 int GC_stopping_pid;
 #endif
 
-/* We hold the allocation lock.  Suspend all threads that might        */
-/* still be running.  Return the number of suspend signals that        */
+/* We hold the allocation lock.  Suspend all threads that might */
+/* still be running.  Return the number of suspend signals that */
 /* were sent. */
 STATIC int GC_suspend_all(void)
 {
@@ -327,7 +344,7 @@ STATIC int GC_suspend_all(void)
     GC_thread p;
     int result;
     pthread_t my_thread = pthread_self();
-    
+
 #   if DEBUG_THREADS
       GC_stopping_thread = my_thread;
       GC_stopping_pid = getpid();
@@ -337,15 +354,15 @@ STATIC int GC_suspend_all(void)
         if (!THREAD_EQUAL(p -> id, my_thread)) {
             if (p -> flags & FINISHED) continue;
             if (p -> stop_info.last_stop_count == GC_stop_count) continue;
-           if (p -> thread_blocked) /* Will wait */ continue;
+            if (p -> thread_blocked) /* Will wait */ continue;
             n_live_threads++;
-#          if DEBUG_THREADS
-             GC_printf("Sending suspend signal to 0x%x\n",
-                       (unsigned)(p -> id));
-#          endif
-        
+#           if DEBUG_THREADS
+              GC_printf("Sending suspend signal to 0x%x\n",
+                        (unsigned)(p -> id));
+#           endif
+
             result = pthread_kill(p -> id, SIG_SUSPEND);
-           switch(result) {
+            switch(result) {
                 case ESRCH:
                     /* Not really there anymore.  Possible? */
                     n_live_threads--;
@@ -371,65 +388,65 @@ void GC_stop_world(void)
 #   if DEBUG_THREADS
       GC_printf("Stopping the world from 0x%x\n", (unsigned)pthread_self());
 #   endif
-       
+
     /* Make sure all free list construction has stopped before we start. */
-    /* No new construction can start, since free list construction is  */
-    /* required to acquire and release the GC lock before it starts,   */
-    /* and we have the lock.                                           */
+    /* No new construction can start, since free list construction is   */
+    /* required to acquire and release the GC lock before it starts,    */
+    /* and we have the lock.                                            */
 #   ifdef PARALLEL_MARK
       if (GC_parallel) {
-       GC_acquire_mark_lock();
-       GC_ASSERT(GC_fl_builder_count == 0);
-       /* We should have previously waited for it to become zero. */
+        GC_acquire_mark_lock();
+        GC_ASSERT(GC_fl_builder_count == 0);
+        /* We should have previously waited for it to become zero. */
       }
 #   endif /* PARALLEL_MARK */
     AO_store(&GC_stop_count, GC_stop_count+1);
-       /* Only concurrent reads are possible. */
+        /* Only concurrent reads are possible. */
     AO_store_release(&GC_world_is_stopped, TRUE);
     n_live_threads = GC_suspend_all();
 
       if (GC_retry_signals) {
-         unsigned long wait_usecs = 0;  /* Total wait since retry.     */
-#        define WAIT_UNIT 3000
-#        define RETRY_INTERVAL 100000
-         for (;;) {
-             int ack_count;
-
-             sem_getvalue(&GC_suspend_ack_sem, &ack_count);
-             if (ack_count == n_live_threads) break;
-             if (wait_usecs > RETRY_INTERVAL) {
-                 int newly_sent = GC_suspend_all();
-
-                 if (GC_print_stats) {
-                     GC_log_printf("Resent %d signals after timeout\n",
-                               newly_sent);
-                 }
-                 sem_getvalue(&GC_suspend_ack_sem, &ack_count);
-                 if (newly_sent < n_live_threads - ack_count) {
-                     WARN("Lost some threads during GC_stop_world?!\n",0);
-                     n_live_threads = ack_count + newly_sent;
-                 }
-                 wait_usecs = 0;
-             }
-             usleep(WAIT_UNIT);
-             wait_usecs += WAIT_UNIT;
-         }
+          unsigned long wait_usecs = 0;  /* Total wait since retry.     */
+#         define WAIT_UNIT 3000
+#         define RETRY_INTERVAL 100000
+          for (;;) {
+              int ack_count;
+
+              sem_getvalue(&GC_suspend_ack_sem, &ack_count);
+              if (ack_count == n_live_threads) break;
+              if (wait_usecs > RETRY_INTERVAL) {
+                  int newly_sent = GC_suspend_all();
+
+                  if (GC_print_stats) {
+                      GC_log_printf("Resent %d signals after timeout\n",
+                                newly_sent);
+                  }
+                  sem_getvalue(&GC_suspend_ack_sem, &ack_count);
+                  if (newly_sent < n_live_threads - ack_count) {
+                      WARN("Lost some threads during GC_stop_world?!\n",0);
+                      n_live_threads = ack_count + newly_sent;
+                  }
+                  wait_usecs = 0;
+              }
+              usleep(WAIT_UNIT);
+              wait_usecs += WAIT_UNIT;
+          }
       }
     for (i = 0; i < n_live_threads; i++) {
-       retry:
-         if (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
-             /* On Linux, sem_wait is documented to always return zero.*/
-             /* But the documentation appears to be incorrect.         */
-             if (errno == EINTR) {
-               /* Seems to happen with some versions of gdb.   */
-               goto retry;
-             }
-             ABORT("sem_wait for handler failed");
-         }
+        retry:
+          if (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+              /* On Linux, sem_wait is documented to always return zero.*/
+              /* But the documentation appears to be incorrect.         */
+              if (errno == EINTR) {
+                /* Seems to happen with some versions of gdb.   */
+                goto retry;
+              }
+              ABORT("sem_wait for handler failed");
+          }
     }
 #   ifdef PARALLEL_MARK
       if (GC_parallel)
-       GC_release_mark_lock();
+        GC_release_mark_lock();
 #   endif
 #   if DEBUG_THREADS
       GC_printf("World stopped from 0x%x\n", (unsigned)pthread_self());
@@ -437,8 +454,8 @@ void GC_stop_world(void)
 #   endif
 }
 
-/* Caller holds allocation lock, and has held it continuously since    */
-/* the world stopped.                                                  */
+/* Caller holds allocation lock, and has held it continuously since     */
+/* the world stopped.                                                   */
 void GC_start_world(void)
 {
     pthread_t my_thread = pthread_self();
@@ -459,15 +476,15 @@ void GC_start_world(void)
       for (p = GC_threads[i]; p != 0; p = p -> next) {
         if (!THREAD_EQUAL(p -> id, my_thread)) {
             if (p -> flags & FINISHED) continue;
-           if (p -> thread_blocked) continue;
+            if (p -> thread_blocked) continue;
             n_live_threads++;
-#          if DEBUG_THREADS
-             GC_printf("Sending restart signal to 0x%x\n",
-                       (unsigned)(p -> id));
-#          endif
-        
+#           if DEBUG_THREADS
+              GC_printf("Sending restart signal to 0x%x\n",
+                        (unsigned)(p -> id));
+#           endif
+
             result = pthread_kill(p -> id, SIG_THR_RESTART);
-           switch(result) {
+            switch(result) {
                 case ESRCH:
                     /* Not really there anymore.  Possible? */
                     n_live_threads--;
@@ -482,12 +499,12 @@ void GC_start_world(void)
     }
 #   ifdef GC_NETBSD_THREADS_WORKAROUND
       for (i = 0; i < n_live_threads; i++)
-       while (0 != (code = sem_wait(&GC_restart_ack_sem)))
-           if (errno != EINTR) {
-               GC_err_printf("sem_wait() returned %d\n",
-                              code);
-               ABORT("sem_wait() for restart handler failed");
-           }
+        while (0 != (code = sem_wait(&GC_restart_ack_sem)))
+            if (errno != EINTR) {
+                GC_err_printf("sem_wait() returned %d\n",
+                               code);
+                ABORT("sem_wait() for restart handler failed");
+            }
 #    endif
 #    if DEBUG_THREADS
       GC_printf("World started\n");
@@ -496,32 +513,32 @@ void GC_start_world(void)
 
 void GC_stop_init(void) {
     struct sigaction act;
-    
+
     if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
         ABORT("sem_init failed");
 #   ifdef GC_NETBSD_THREADS_WORKAROUND
       if (sem_init(&GC_restart_ack_sem, 0, 0) != 0)
-       ABORT("sem_init failed");
+        ABORT("sem_init failed");
 #   endif
 
     act.sa_flags = SA_RESTART
 #   ifdef SA_SIGINFO
-       | SA_SIGINFO
+        | SA_SIGINFO
 #   endif
-       ;
+        ;
     if (sigfillset(&act.sa_mask) != 0) {
-       ABORT("sigfillset() failed");
+        ABORT("sigfillset() failed");
     }
     GC_remove_allowed_signals(&act.sa_mask);
-    /* SIG_THR_RESTART is set in the resulting mask.           */
-    /* It is unmasked by the handler when necessary.           */
+    /* SIG_THR_RESTART is set in the resulting mask.            */
+    /* It is unmasked by the handler when necessary.            */
 #   ifdef SA_SIGINFO
     act.sa_sigaction = GC_suspend_handler;
 #   else
     act.sa_handler = GC_suspend_handler;
 #   endif
     if (sigaction(SIG_SUSPEND, &act, NULL) != 0) {
-       ABORT("Cannot set SIG_SUSPEND handler");
+        ABORT("Cannot set SIG_SUSPEND handler");
     }
 
 #   ifdef SA_SIGINFO
@@ -529,21 +546,21 @@ void GC_stop_init(void) {
 #   endif
     act.sa_handler = GC_restart_handler;
     if (sigaction(SIG_THR_RESTART, &act, NULL) != 0) {
-       ABORT("Cannot set SIG_THR_RESTART handler");
+        ABORT("Cannot set SIG_THR_RESTART handler");
     }
 
     /* Initialize suspend_handler_mask. It excludes SIG_THR_RESTART. */
       if (sigfillset(&suspend_handler_mask) != 0) ABORT("sigfillset() failed");
       GC_remove_allowed_signals(&suspend_handler_mask);
       if (sigdelset(&suspend_handler_mask, SIG_THR_RESTART) != 0)
-         ABORT("sigdelset() failed");
+          ABORT("sigdelset() failed");
 
-    /* Check for GC_RETRY_SIGNALS.     */
+    /* Check for GC_RETRY_SIGNALS.      */
       if (0 != GETENV("GC_RETRY_SIGNALS")) {
-         GC_retry_signals = TRUE;
+          GC_retry_signals = TRUE;
       }
       if (0 != GETENV("GC_NO_RETRY_SIGNALS")) {
-         GC_retry_signals = FALSE;
+          GC_retry_signals = FALSE;
       }
       if (GC_print_stats && GC_retry_signals) {
           GC_log_printf("Will retry suspend signal if necessary.\n");
index e26b084..a115609 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996 by Silicon Graphics.  All rights reserved.
  * Copyright (c) 1998 by Fergus Henderson.  All rights reserved.
 # include "private/thread_local_alloc.h"
 #endif /* THREAD_LOCAL_ALLOC */
 
-/* Allocation lock declarations.       */
+/* Allocation lock declarations.        */
 #if !defined(USE_PTHREAD_LOCKS)
   CRITICAL_SECTION GC_allocate_ml;
   DWORD GC_lock_holder = NO_THREAD;
-       /* Thread id for current holder of allocation lock */
+        /* Thread id for current holder of allocation lock */
 #else
   pthread_mutex_t GC_allocate_ml = PTHREAD_MUTEX_INITIALIZER;
   unsigned long GC_lock_holder = NO_THREAD;
 # include <errno.h> /* for EAGAIN */
 
  /* Cygwin-specific forward decls */
-# undef pthread_create 
-# undef pthread_sigmask 
-# undef pthread_join 
+# undef pthread_create
+# undef pthread_sigmask
+# undef pthread_join
 # undef pthread_detach
-# undef dlopen 
+# undef dlopen
 
 # ifdef DEBUG_THREADS
 #   ifdef CYGWIN32
@@ -83,8 +83,8 @@
 # endif
 
 # ifdef MSWINCE
-    /* Force DONT_USE_SIGNALANDWAIT implementation of PARALLEL_MARK    */
-    /* for WinCE (since Win32 SignalObjectAndWait() is missing).       */
+    /* Force DONT_USE_SIGNALANDWAIT implementation of PARALLEL_MARK     */
+    /* for WinCE (since Win32 SignalObjectAndWait() is missing).        */
 #   ifndef DONT_USE_SIGNALANDWAIT
 #     define DONT_USE_SIGNALANDWAIT
 #   endif
 
 #endif
 
-/* DllMain-based thread registration is currently incompatible */
-/* with thread-local allocation, pthreads and WinCE.           */
+/* DllMain-based thread registration is currently incompatible  */
+/* with thread-local allocation, pthreads and WinCE.            */
 #if defined(GC_DLL) && !defined(GC_NO_DLLMAIN) && !defined(MSWINCE) \
-       && !defined(THREAD_LOCAL_ALLOC) && !defined(GC_PTHREADS)
+        && !defined(THREAD_LOCAL_ALLOC) && !defined(GC_PTHREADS)
 # include "atomic_ops.h"
 
   static GC_bool GC_win32_dll_threads = FALSE;
-  /* This code operates in two distinct modes, depending on    */
-  /* the setting of GC_win32_dll_threads.  If                  */
-  /* GC_win32_dll_threads is set, all threads in the process   */
-  /* are implicitly registered with the GC by DllMain.                 */
-  /* No explicit registration is required, and attempts at     */
-  /* explicit registration are ignored.  This mode is          */
-  /* very different from the Posix operation of the collector. */
-  /* In this mode access to the thread table is lock-free.     */
-  /* Hence there is a static limit on the number of threads.   */
-  
-  /* If GC_win32_dll_threads is FALSE, or the collector is     */
-  /* built without GC_DLL defined, things operate in a way     */
-  /* that is very similar to Posix platforms, and new threads  */
-  /* must be registered with the collector, e.g. by using      */
-  /* preprocessor-based interception of the thread primitives. */
-  /* In this case, we use a real data structure for the thread */
-  /* table.  Note that there is no equivalent of linker-based  */
-  /* call interception, since we don't have ELF-like           */
-  /* facilities.  The Windows analog appears to be "API                */
-  /* hooking", which really seems to be a standard way to      */
-  /* do minor binary rewriting (?).  I'd prefer not to have    */
-  /* the basic collector rely on such facilities, but an       */
-  /* optional package that intercepts thread calls this way    */
-  /* would probably be nice.                                   */
-
-  /* GC_win32_dll_threads must be set at initialization time,  */
-  /* i.e. before any collector or thread calls.  We make it a  */
-  /* "dynamic" option only to avoid multiple library versions. */
+  /* This code operates in two distinct modes, depending on     */
+  /* the setting of GC_win32_dll_threads.  If                   */
+  /* GC_win32_dll_threads is set, all threads in the process    */
+  /* are implicitly registered with the GC by DllMain.          */
+  /* No explicit registration is required, and attempts at      */
+  /* explicit registration are ignored.  This mode is           */
+  /* very different from the Posix operation of the collector.  */
+  /* In this mode access to the thread table is lock-free.      */
+  /* Hence there is a static limit on the number of threads.    */
+
+  /* If GC_win32_dll_threads is FALSE, or the collector is      */
+  /* built without GC_DLL defined, things operate in a way      */
+  /* that is very similar to Posix platforms, and new threads   */
+  /* must be registered with the collector, e.g. by using       */
+  /* preprocessor-based interception of the thread primitives.  */
+  /* In this case, we use a real data structure for the thread  */
+  /* table.  Note that there is no equivalent of linker-based   */
+  /* call interception, since we don't have ELF-like            */
+  /* facilities.  The Windows analog appears to be "API         */
+  /* hooking", which really seems to be a standard way to       */
+  /* do minor binary rewriting (?).  I'd prefer not to have     */
+  /* the basic collector rely on such facilities, but an        */
+  /* optional package that intercepts thread calls this way     */
+  /* would probably be nice.                                    */
+
+  /* GC_win32_dll_threads must be set at initialization time,   */
+  /* i.e. before any collector or thread calls.  We make it a   */
+  /* "dynamic" option only to avoid multiple library versions.  */
 #else
 # ifndef GC_NO_DLLMAIN
 #   define GC_NO_DLLMAIN
 # endif
 # define GC_win32_dll_threads FALSE
 # undef MAX_THREADS
-# define MAX_THREADS 1 /* dll_thread_table[] is always empty.  */
+# define MAX_THREADS 1 /* dll_thread_table[] is always empty.   */
 #endif
 
-/* We have two versions of the thread table.  Which one        */
+/* We have two versions of the thread table.  Which one */
 /* we us depends on whether or not GC_win32_dll_threads */
-/* is set.  Note that before initialization, we don't  */
-/* add any entries to either table, even if DllMain is */
-/* called.  The main thread will be added on           */
-/* initialization.                                     */
-
-/* The type of the first argument to InterlockedExchange.      */
-/* Documented to be LONG volatile *, but at least gcc likes    */
-/* this better.                                                        */
+/* is set.  Note that before initialization, we don't   */
+/* add any entries to either table, even if DllMain is  */
+/* called.  The main thread will be added on            */
+/* initialization.                                      */
+
+/* The type of the first argument to InterlockedExchange.       */
+/* Documented to be LONG volatile *, but at least gcc likes     */
+/* this better.                                                 */
 typedef LONG * IE_t;
 
 GC_bool GC_thr_initialized = FALSE;
@@ -158,16 +158,16 @@ static GC_bool parallel_initialized = FALSE;
 
 void GC_init_parallel(void);
 
-/* GC_use_DllMain() is currently incompatible with pthreads and WinCE. */
-/* It might be possible to get DllMain-based thread registration to    */
-/* work with Cygwin, but if you try, you are on your own.              */
+/* GC_use_DllMain() is currently incompatible with pthreads and WinCE.  */
+/* It might be possible to get DllMain-based thread registration to     */
+/* work with Cygwin, but if you try, you are on your own.               */
 #ifndef GC_NO_DLLMAIN
-  /* Turn on GC_win32_dll_threads      */
+  /* Turn on GC_win32_dll_threads       */
   GC_API void GC_CALL GC_use_DllMain(void)
   {
-         GC_ASSERT(!parallel_initialized);
-         GC_win32_dll_threads = TRUE;
-         GC_init_parallel();
+          GC_ASSERT(!parallel_initialized);
+          GC_win32_dll_threads = TRUE;
+          GC_init_parallel();
   }
 #else
   GC_API void GC_CALL GC_use_DllMain(void)
@@ -183,73 +183,73 @@ STATIC DWORD GC_main_thread = 0;
 struct GC_Thread_Rep {
   union {
 #   ifndef GC_NO_DLLMAIN
-      AO_t tm_in_use;  /* Updated without lock.                */
-                       /* We assert that unused                */
-                       /* entries have invalid ids of          */
-                       /* zero and zero stack fields.          */
-                       /* Used only with GC_win32_dll_threads. */
+      AO_t tm_in_use;   /* Updated without lock.                */
+                        /* We assert that unused                */
+                        /* entries have invalid ids of          */
+                        /* zero and zero stack fields.          */
+                        /* Used only with GC_win32_dll_threads. */
 #   endif
     struct GC_Thread_Rep * tm_next;
-                       /* Hash table link without              */
-                       /* GC_win32_dll_threads.                */
-                       /* More recently allocated threads      */
-                       /* with a given pthread id come         */
-                       /* first.  (All but the first are       */
-                       /* guaranteed to be dead, but we may    */
-                       /* not yet have registered the join.)   */
+                        /* Hash table link without              */
+                        /* GC_win32_dll_threads.                */
+                        /* More recently allocated threads      */
+                        /* with a given pthread id come         */
+                        /* first.  (All but the first are       */
+                        /* guaranteed to be dead, but we may    */
+                        /* not yet have registered the join.)   */
   } table_management;
 # define in_use table_management.tm_in_use
 # define next table_management.tm_next
   DWORD id;
 
 # ifdef MSWINCE
-    /* According to MSDN specs for WinCE targets:                      */
-    /* - DuplicateHandle() is not applicable to        thread handles; and     */
-    /* - the value returned by GetCurrentThreadId() could be used as   */
-    /* a "real" thread handle (for SuspendThread(), ResumeThread() and */
-    /* GetThreadContext()).                                            */
+    /* According to MSDN specs for WinCE targets:                       */
+    /* - DuplicateHandle() is not applicable to thread handles; and     */
+    /* - the value returned by GetCurrentThreadId() could be used as    */
+    /* a "real" thread handle (for SuspendThread(), ResumeThread() and  */
+    /* GetThreadContext()).                                             */
 #   define THREAD_HANDLE(t) (HANDLE)(word)(t)->id
 # else
     HANDLE handle;
 #   define THREAD_HANDLE(t) (t)->handle
 # endif
 
-  ptr_t stack_base;    /* The cold end of the stack.   */
-                       /* 0 ==> entry not valid.       */
-                       /* !in_use ==> stack_base == 0  */
-  ptr_t last_stack_min;        /* Last known minimum (hottest) address */
-                       /* in stack or ADDR_LIMIT if unset      */
+  ptr_t stack_base;     /* The cold end of the stack.   */
+                        /* 0 ==> entry not valid.       */
+                        /* !in_use ==> stack_base == 0  */
+  ptr_t last_stack_min; /* Last known minimum (hottest) address */
+                        /* in stack or ADDR_LIMIT if unset      */
 # ifdef IA64
     ptr_t backing_store_end;
     ptr_t backing_store_ptr;
 # endif
 
-  ptr_t thread_blocked_sp;     /* Protected by GC lock.                */
-                               /* NULL value means thread unblocked.   */
-                               /* If set to non-NULL, thread will      */
-                               /* acquire GC lock before doing any     */
-                               /* pointer manipulations.  Thus it does */
-                               /* not need to stop this thread.        */
+  ptr_t thread_blocked_sp;      /* Protected by GC lock.                */
+                                /* NULL value means thread unblocked.   */
+                                /* If set to non-NULL, thread will      */
+                                /* acquire GC lock before doing any     */
+                                /* pointer manipulations.  Thus it does */
+                                /* not need to stop this thread.        */
 
   struct GC_activation_frame_s *activation_frame;
-                       /* Points to the "frame" data held in stack by  */
-                       /* the innermost GC_call_with_gc_active() of    */
-                       /* this thread.  May be NULL.                   */
+                        /* Points to the "frame" data held in stack by  */
+                        /* the innermost GC_call_with_gc_active() of    */
+                        /* this thread.  May be NULL.                   */
 
   unsigned finalizer_nested;
-  unsigned finalizer_skipped;  /* Used by GC_check_finalizer_nested()  */
-                               /* to minimize the level of recursion   */
-                               /* when a client finalizer allocates    */
-                               /* memory (initially both are 0).       */
+  unsigned finalizer_skipped;   /* Used by GC_check_finalizer_nested()  */
+                                /* to minimize the level of recursion   */
+                                /* when a client finalizer allocates    */
+                                /* memory (initially both are 0).       */
 
   GC_bool suspended;
 
 # ifdef GC_PTHREADS
     void *status; /* hold exit value until join in case it's a pointer */
     pthread_t pthread_id;
-    short flags;               /* Protected by GC lock.        */
-#      define FINISHED 1       /* Thread has exited.   */
-#      define DETACHED 2       /* Thread is intended to be detached.   */
+    short flags;                /* Protected by GC lock.        */
+#       define FINISHED 1       /* Thread has exited.   */
+#       define DETACHED 2       /* Thread is intended to be detached.   */
 #   define KNOWN_FINISHED(t) (((t) -> flags) & FINISHED)
 # else
 #   define KNOWN_FINISHED(t) 0
@@ -280,15 +280,15 @@ volatile GC_bool GC_please_stop = FALSE;
   STATIC AO_t GC_attached_thread = FALSE;
 #endif
 
-/* Return TRUE if an thread was attached since we last asked or        */
-/* since GC_attached_thread was explicitly reset.              */
+/* Return TRUE if an thread was attached since we last asked or */
+/* since GC_attached_thread was explicitly reset.               */
 GC_bool GC_started_thread_while_stopped(void)
 {
 #ifndef GC_NO_DLLMAIN
   AO_t result;
 
   if (GC_win32_dll_threads) {
-    AO_nop_full();     /* Prior heap reads need to complete earlier. */
+    AO_nop_full();      /* Prior heap reads need to complete earlier. */
     result = AO_load(&GC_attached_thread);
     if (result) {
       AO_store(&GC_attached_thread, FALSE);
@@ -299,55 +299,55 @@ GC_bool GC_started_thread_while_stopped(void)
   return FALSE;
 }
 
-/* Thread table used if GC_win32_dll_threads is set.   */
-/* This is a fixed size array.                         */
-/* Since we use runtime conditionals, both versions    */
-/* are always defined.                                 */
+/* Thread table used if GC_win32_dll_threads is set.    */
+/* This is a fixed size array.                          */
+/* Since we use runtime conditionals, both versions     */
+/* are always defined.                                  */
 # ifndef MAX_THREADS
 #   define MAX_THREADS 512
 #  endif
-  /* Things may get quite slow for large numbers of threads,   */
-  /* since we look them up with sequential search.             */
+  /* Things may get quite slow for large numbers of threads,    */
+  /* since we look them up with sequential search.              */
 
   volatile struct GC_Thread_Rep dll_thread_table[MAX_THREADS];
 
   volatile LONG GC_max_thread_index = 0;
-                       /* Largest index in dll_thread_table    */
-                       /* that was ever used.                  */
+                        /* Largest index in dll_thread_table    */
+                        /* that was ever used.                  */
 
-/* And now the version used if GC_win32_dll_threads is not set.        */
-/* This is a chained hash table, with much of the code borrowed        */
-/* From the Posix implementation.                              */
+/* And now the version used if GC_win32_dll_threads is not set. */
+/* This is a chained hash table, with much of the code borrowed */
+/* From the Posix implementation.                               */
 #ifndef THREAD_TABLE_SZ
-# define THREAD_TABLE_SZ 256   /* Must be power of 2   */
+# define THREAD_TABLE_SZ 256    /* Must be power of 2   */
 #endif
   STATIC GC_thread GC_threads[THREAD_TABLE_SZ];
-  
-  /* It may not be safe to allocate when we register the first thread. */
-  /* Thus we allocated one statically.                                 */
+
+  /* It may not be safe to allocate when we register the first thread.  */
+  /* Thus we allocated one statically.                                  */
   static struct GC_Thread_Rep first_thread;
   static GC_bool first_thread_used = FALSE;
 
-/* Add a thread to GC_threads.  We assume it wasn't already there.     */
-/* Caller holds allocation lock.                                       */
-/* Unlike the pthreads version, the id field is set by the caller.     */
+/* Add a thread to GC_threads.  We assume it wasn't already there.      */
+/* Caller holds allocation lock.                                        */
+/* Unlike the pthreads version, the id field is set by the caller.      */
 STATIC GC_thread GC_new_thread(DWORD id)
 {
     word hv = ((word)id) % THREAD_TABLE_SZ;
     GC_thread result;
-    
+
     GC_ASSERT(I_HOLD_LOCK());
     if (!first_thread_used) {
-       result = &first_thread;
-       first_thread_used = TRUE;
+        result = &first_thread;
+        first_thread_used = TRUE;
     } else {
         GC_ASSERT(!GC_win32_dll_threads);
         result = (struct GC_Thread_Rep *)
-                GC_INTERNAL_MALLOC(sizeof(struct GC_Thread_Rep), NORMAL);
-       /* result can be NULL */
-       if (result == 0) return(0);
+                 GC_INTERNAL_MALLOC(sizeof(struct GC_Thread_Rep), NORMAL);
+        /* result can be NULL */
+        if (result == 0) return(0);
     }
-    /* result -> id = id; Done by caller.      */
+    /* result -> id = id; Done by caller.       */
     result -> next = GC_threads[hv];
     GC_threads[hv] = result;
 #   ifdef GC_PTHREADS
@@ -361,8 +361,8 @@ extern LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info);
 
 #if defined(GWW_VDB) && defined(MPROTECT_VDB)
   extern GC_bool GC_gww_dirty_init(void);
-  /* Defined in os_dep.c.  Returns TRUE if GetWriteWatch is available.         */
-  /* may be called repeatedly.                                         */
+  /* Defined in os_dep.c.  Returns TRUE if GetWriteWatch is available.  */
+  /* may be called repeatedly.                                          */
 #endif
 
 GC_bool GC_in_thread_creation = FALSE;  /* Protected by allocation lock. */
@@ -375,17 +375,17 @@ GC_bool GC_in_thread_creation = FALSE;  /* Protected by allocation lock. */
  * except possibly during single-threaded start-up code.
  */
 static GC_thread GC_register_my_thread_inner(const struct GC_stack_base *sb,
-                                            DWORD thread_id)
+                                             DWORD thread_id)
 {
   GC_vthread me;
 
-  /* The following should be a no-op according to the win32    */
-  /* documentation.  There is empirical evidence that it       */
-  /* isn't.            - HB                                    */
+  /* The following should be a no-op according to the win32     */
+  /* documentation.  There is empirical evidence that it        */
+  /* isn't.             - HB                                    */
 # if defined(MPROTECT_VDB)
 #   if defined(GWW_VDB)
       if (GC_incremental && !GC_gww_dirty_init())
-       SetUnhandledExceptionFilter(GC_write_fault_handler);
+        SetUnhandledExceptionFilter(GC_write_fault_handler);
 #   else
       if (GC_incremental) SetUnhandledExceptionFilter(GC_write_fault_handler);
 #   endif
@@ -394,41 +394,41 @@ static GC_thread GC_register_my_thread_inner(const struct GC_stack_base *sb,
 #ifndef GC_NO_DLLMAIN
   if (GC_win32_dll_threads) {
     int i;
-    /* It appears to be unsafe to acquire a lock here, since this      */
-    /* code is apparently not preemptible on some systems.             */
-    /* (This is based on complaints, not on Microsoft's official       */
-    /* documentation, which says this should perform "only simple      */
-    /* initialization tasks".)                                         */
-    /* Hence we make do with nonblocking synchronization.              */
-    /* It has been claimed that DllMain is really only executed with   */
-    /* a particular system lock held, and thus careful use of locking  */
-    /* around code that doesn't call back into the system libraries    */
-    /* might be OK.  But this hasn't been tested across all win32      */
-    /* variants.                                                       */
+    /* It appears to be unsafe to acquire a lock here, since this       */
+    /* code is apparently not preemptible on some systems.              */
+    /* (This is based on complaints, not on Microsoft's official        */
+    /* documentation, which says this should perform "only simple       */
+    /* initialization tasks".)                                          */
+    /* Hence we make do with nonblocking synchronization.               */
+    /* It has been claimed that DllMain is really only executed with    */
+    /* a particular system lock held, and thus careful use of locking   */
+    /* around code that doesn't call back into the system libraries     */
+    /* might be OK.  But this hasn't been tested across all win32       */
+    /* variants.                                                        */
                 /* cast away volatile qualifier */
     for (i = 0; InterlockedExchange((void*)&dll_thread_table[i].in_use,1) != 0;
-        i++) {
-      /* Compare-and-swap would make this cleaner, but that's not      */
-      /* supported before Windows 98 and NT 4.0.  In Windows 2000,     */
-      /* InterlockedExchange is supposed to be replaced by             */
-      /* InterlockedExchangePointer, but that's not really what I      */
-      /* want here.                                                    */
-      /* FIXME: We should eventually declare Win95 dead and use AO_    */
-      /* primitives here.                                              */
+         i++) {
+      /* Compare-and-swap would make this cleaner, but that's not       */
+      /* supported before Windows 98 and NT 4.0.  In Windows 2000,      */
+      /* InterlockedExchange is supposed to be replaced by              */
+      /* InterlockedExchangePointer, but that's not really what I       */
+      /* want here.                                                     */
+      /* FIXME: We should eventually declare Win95 dead and use AO_     */
+      /* primitives here.                                               */
       if (i == MAX_THREADS - 1)
         ABORT("too many threads");
     }
-    /* Update GC_max_thread_index if necessary.  The following is safe,        */
-    /* and unlike CompareExchange-based solutions seems to work on all */
-    /* Windows95 and later platforms.                                  */
-    /* Unfortunately, GC_max_thread_index may be temporarily out of    */
-    /* bounds, so readers have to compensate.                          */
+    /* Update GC_max_thread_index if necessary.  The following is safe, */
+    /* and unlike CompareExchange-based solutions seems to work on all  */
+    /* Windows95 and later platforms.                                   */
+    /* Unfortunately, GC_max_thread_index may be temporarily out of     */
+    /* bounds, so readers have to compensate.                           */
     while (i > GC_max_thread_index) {
       InterlockedIncrement((IE_t)&GC_max_thread_index);
     }
     if (GC_max_thread_index >= MAX_THREADS) {
-      /* We overshot due to simultaneous increments.   */
-      /* Setting it to MAX_THREADS-1 is always safe.   */
+      /* We overshot due to simultaneous increments.    */
+      /* Setting it to MAX_THREADS-1 is always safe.    */
       GC_max_thread_index = MAX_THREADS - 1;
     }
     me = dll_thread_table + i;
@@ -447,14 +447,14 @@ static GC_thread GC_register_my_thread_inner(const struct GC_stack_base *sb,
     me -> pthread_id = pthread_self();
 # endif
 # ifndef MSWINCE
-    /* GetCurrentThread() returns a pseudohandle (a const value).      */
+    /* GetCurrentThread() returns a pseudohandle (a const value).       */
     if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
-                       GetCurrentProcess(),
-                       (HANDLE*)&(me -> handle),
-                       0 /* dwDesiredAccess */, FALSE /* bInheritHandle */,
-                       DUPLICATE_SAME_ACCESS)) {
-       GC_err_printf("Last error code: %d\n", (int)GetLastError());
-       ABORT("DuplicateHandle failed");
+                        GetCurrentProcess(),
+                        (HANDLE*)&(me -> handle),
+                        0 /* dwDesiredAccess */, FALSE /* bInheritHandle */,
+                        DUPLICATE_SAME_ACCESS)) {
+        GC_err_printf("Last error code: %d\n", (int)GetLastError());
+        ABORT("DuplicateHandle failed");
     }
 # endif
   me -> last_stack_min = ADDR_LIMIT;
@@ -462,31 +462,31 @@ static GC_thread GC_register_my_thread_inner(const struct GC_stack_base *sb,
 # ifdef IA64
       me -> backing_store_end = sb -> reg_base;
 # endif
-  /* Up until this point, GC_push_all_stacks considers this thread     */
-  /* invalid.                                                          */
-  /* Up until this point, this entry is viewed as reserved but invalid */
-  /* by GC_delete_thread.                                              */
+  /* Up until this point, GC_push_all_stacks considers this thread      */
+  /* invalid.                                                           */
+  /* Up until this point, this entry is viewed as reserved but invalid  */
+  /* by GC_delete_thread.                                               */
   me -> id = thread_id;
 # if defined(THREAD_LOCAL_ALLOC)
       GC_init_thread_local((GC_tlfs)(&(me->tlfs)));
 # endif
-  if (me -> stack_base == NULL) 
+  if (me -> stack_base == NULL)
       ABORT("Bad stack base in GC_register_my_thread_inner");
 #ifndef GC_NO_DLLMAIN
   if (GC_win32_dll_threads) {
     if (GC_please_stop) {
       AO_store(&GC_attached_thread, TRUE);
-      AO_nop_full();  /* Later updates must become visible after this. */
+      AO_nop_full();  /* Later updates must become visible after this.  */
     }
-    /* We'd like to wait here, but can't, since waiting in DllMain     */
-    /* provokes deadlocks.                                             */
-    /* Thus we force marking to be restarted instead.                  */
+    /* We'd like to wait here, but can't, since waiting in DllMain      */
+    /* provokes deadlocks.                                              */
+    /* Thus we force marking to be restarted instead.                   */
   } else
 #endif
   /* else */ {
     GC_ASSERT(!GC_please_stop);
-       /* Otherwise both we and the thread stopping code would be      */
-       /* holding the allocation lock.                                 */
+        /* Otherwise both we and the thread stopping code would be      */
+        /* holding the allocation lock.                                 */
   }
   return (GC_thread)(me);
 }
@@ -506,13 +506,13 @@ STATIC LONG GC_get_max_thread_index(void)
   return my_max;
 }
 
-/* Return the GC_thread corresponding to a thread id.  May be called   */
-/* without a lock, but should be called in contexts in which the       */
-/* requested thread cannot be asynchronously deleted, e.g. from the    */
-/* thread itself.                                                      */
-/* This version assumes that either GC_win32_dll_threads is set, or    */
-/* we hold the allocator lock.                                         */
-/* Also used (for assertion checking only) from thread_local_alloc.c.  */
+/* Return the GC_thread corresponding to a thread id.  May be called    */
+/* without a lock, but should be called in contexts in which the        */
+/* requested thread cannot be asynchronously deleted, e.g. from the     */
+/* thread itself.                                                       */
+/* This version assumes that either GC_win32_dll_threads is set, or     */
+/* we hold the allocator lock.                                          */
+/* Also used (for assertion checking only) from thread_local_alloc.c.   */
 GC_thread GC_lookup_thread_inner(DWORD thread_id) {
 #ifndef GC_NO_DLLMAIN
   if (GC_win32_dll_threads) {
@@ -521,7 +521,7 @@ GC_thread GC_lookup_thread_inner(DWORD thread_id) {
     for (i = 0;
        i <= my_max &&
        (!AO_load_acquire(&(dll_thread_table[i].in_use))
-       || dll_thread_table[i].id != thread_id);
+        || dll_thread_table[i].id != thread_id);
        /* Must still be in_use, since nobody else can store our thread_id. */
        i++) {}
     if (i > my_max) {
@@ -534,35 +534,35 @@ GC_thread GC_lookup_thread_inner(DWORD thread_id) {
   {
     word hv = ((word)thread_id) % THREAD_TABLE_SZ;
     register GC_thread p = GC_threads[hv];
-    
+
     GC_ASSERT(I_HOLD_LOCK());
     while (p != 0 && p -> id != thread_id) p = p -> next;
     return(p);
   }
 }
 
-/* Called by GC_finalize() (in case of an allocation failure observed).        */
-/* GC_reset_finalizer_nested() is the same as in pthread_support.c.    */
+/* Called by GC_finalize() (in case of an allocation failure observed). */
+/* GC_reset_finalizer_nested() is the same as in pthread_support.c.     */
 void GC_reset_finalizer_nested(void)
 {
   GC_thread me = GC_lookup_thread_inner(GetCurrentThreadId());
   me->finalizer_nested = 0;
 }
 
-/* Checks and updates the thread-local level of finalizers recursion.  */
-/* Returns NULL if GC_invoke_finalizers() should not be called by the  */
-/* collector (to minimize the risk of a deep finalizers recursion),    */
-/* otherwise returns a pointer to the thread-local finalizer_nested.   */
-/* Called by GC_notify_or_invoke_finalizers() only (the lock is held). */
-/* GC_check_finalizer_nested() is the same as in pthread_support.c.    */
+/* Checks and updates the thread-local level of finalizers recursion.   */
+/* Returns NULL if GC_invoke_finalizers() should not be called by the   */
+/* collector (to minimize the risk of a deep finalizers recursion),     */
+/* otherwise returns a pointer to the thread-local finalizer_nested.    */
+/* Called by GC_notify_or_invoke_finalizers() only (the lock is held).  */
+/* GC_check_finalizer_nested() is the same as in pthread_support.c.     */
 unsigned *GC_check_finalizer_nested(void)
 {
   GC_thread me = GC_lookup_thread_inner(GetCurrentThreadId());
   unsigned nesting_level = me->finalizer_nested;
   if (nesting_level) {
-    /* We are inside another GC_invoke_finalizers().           */
-    /* Skip some implicitly-called GC_invoke_finalizers()      */
-    /* depending on the nesting (recursion) level.             */
+    /* We are inside another GC_invoke_finalizers().            */
+    /* Skip some implicitly-called GC_invoke_finalizers()       */
+    /* depending on the nesting (recursion) level.              */
     if (++me->finalizer_skipped < (1U << nesting_level)) return NULL;
     me->finalizer_skipped = 0;
   }
@@ -570,11 +570,11 @@ unsigned *GC_check_finalizer_nested(void)
   return &me->finalizer_nested;
 }
 
-/* Make sure thread descriptor t is not protected by the VDB           */
-/* implementation.                                                     */
-/* Used to prevent write faults when the world is (partially) stopped, */
-/* since it may have been stopped with a system lock held, and that    */
-/* lock may be required for fault handling.                            */
+/* Make sure thread descriptor t is not protected by the VDB            */
+/* implementation.                                                      */
+/* Used to prevent write faults when the world is (partially) stopped,  */
+/* since it may have been stopped with a system lock held, and that     */
+/* lock may be required for fault handling.                             */
 # if defined(MPROTECT_VDB)
 #    define UNPROTECT(t) \
        if (GC_dirty_maintained && !GC_win32_dll_threads && \
@@ -586,14 +586,14 @@ unsigned *GC_check_finalizer_nested(void)
 #    define UNPROTECT(t)
 # endif
 
-/* If a thread has been joined, but we have not yet            */
-/* been notified, then there may be more than one thread       */
-/* in the table with the same win32 id.                                */
-/* This is OK, but we need a way to delete a specific one.     */
-/* Assumes we hold the allocation lock unless                  */
-/* GC_win32_dll_threads is set.                                        */
-/* If GC_win32_dll_threads is set it should be called from the */
-/* thread being deleted.                                       */
+/* If a thread has been joined, but we have not yet             */
+/* been notified, then there may be more than one thread        */
+/* in the table with the same win32 id.                         */
+/* This is OK, but we need a way to delete a specific one.      */
+/* Assumes we hold the allocation lock unless                   */
+/* GC_win32_dll_threads is set.                                 */
+/* If GC_win32_dll_threads is set it should be called from the  */
+/* thread being deleted.                                        */
 STATIC void GC_delete_gc_thread(GC_vthread gc_id)
 {
 # ifndef MSWINCE
@@ -601,10 +601,10 @@ STATIC void GC_delete_gc_thread(GC_vthread gc_id)
 # endif
 #ifndef GC_NO_DLLMAIN
   if (GC_win32_dll_threads) {
-    /* This is intended to be lock-free.                               */
-    /* It is either called synchronously from the thread being deleted,        */
-    /* or by the joining thread.                                       */
-    /* In this branch asynchronous changes to *gc_id are possible.     */
+    /* This is intended to be lock-free.                                */
+    /* It is either called synchronously from the thread being deleted, */
+    /* or by the joining thread.                                        */
+    /* In this branch asynchronous changes to *gc_id are possible.      */
     gc_id -> stack_base = 0;
     gc_id -> id = 0;
 #   ifdef CYGWIN32
@@ -638,12 +638,12 @@ STATIC void GC_delete_gc_thread(GC_vthread gc_id)
   }
 }
 
-/* Delete a thread from GC_threads.  We assume it is there.    */
-/* (The code intentionally traps if it wasn't.)                        */
-/* Assumes we hold the allocation lock unless                  */
-/* GC_win32_dll_threads is set.                                        */
-/* If GC_win32_dll_threads is set it should be called from the */
-/* thread being deleted.                                       */
+/* Delete a thread from GC_threads.  We assume it is there.     */
+/* (The code intentionally traps if it wasn't.)                 */
+/* Assumes we hold the allocation lock unless                   */
+/* GC_win32_dll_threads is set.                                 */
+/* If GC_win32_dll_threads is set it should be called from the  */
+/* thread being deleted.                                        */
 STATIC void GC_delete_thread(DWORD id)
 {
   if (GC_win32_dll_threads) {
@@ -658,7 +658,7 @@ STATIC void GC_delete_thread(DWORD id)
     word hv = ((word)id) % THREAD_TABLE_SZ;
     register GC_thread p = GC_threads[hv];
     register GC_thread prev = 0;
-    
+
     GC_ASSERT(I_HOLD_LOCK());
     while (p -> id != id) {
         prev = p;
@@ -682,7 +682,7 @@ GC_API void GC_CALL GC_allow_register_threads(void)
   GC_ASSERT(GC_lookup_thread_inner(GetCurrentThreadId()) != 0);
 
 # if !defined(GC_NO_DLLMAIN) && !defined(PARALLEL_MARK)
-    /* GC_init() doesn't call GC_init_parallel() in this case. */
+    /* GC_init() doesn't call GC_init_parallel() in this case.  */
     parallel_initialized = TRUE;
 # endif
   GC_need_to_lock = TRUE; /* We are multi-threaded now. */
@@ -694,7 +694,7 @@ GC_API int GC_CALL GC_register_my_thread(const struct GC_stack_base *sb) {
   if (GC_need_to_lock == FALSE)
     ABORT("Threads explicit registering is not previously enabled");
 
-  /* We lock here, since we want to wait for an ongoing GC.    */
+  /* We lock here, since we want to wait for an ongoing GC.     */
   LOCK();
   if (0 == GC_lookup_thread_inner(t)) {
     GC_register_my_thread_inner(sb, t);
@@ -712,18 +712,18 @@ GC_API int GC_CALL GC_unregister_my_thread(void)
 
     if (GC_win32_dll_threads) {
 #     if defined(THREAD_LOCAL_ALLOC)
-       /* Can't happen: see GC_use_DllMain(). */
-       GC_ASSERT(FALSE);
+        /* Can't happen: see GC_use_DllMain(). */
+        GC_ASSERT(FALSE);
 #     endif
       /* FIXME: Should we just ignore this? */
       GC_delete_thread(t);
     } else {
       LOCK();
 #     if defined(THREAD_LOCAL_ALLOC)
-       {
-         GC_thread me = GC_lookup_thread_inner(t);
-         GC_destroy_thread_local(&(me->tlfs));
-       }
+        {
+          GC_thread me = GC_lookup_thread_inner(t);
+          GC_destroy_thread_local(&(me->tlfs));
+        }
 #     endif
       GC_delete_thread(t);
       UNLOCK();
@@ -731,10 +731,10 @@ GC_API int GC_CALL GC_unregister_my_thread(void)
     return GC_SUCCESS;
 }
 
-/* Wrapper for functions that are likely to block for an appreciable   */
-/* length of time.                                                     */
+/* Wrapper for functions that are likely to block for an appreciable    */
+/* length of time.                                                      */
 
-/* GC_do_blocking_inner() is nearly the same as in pthread_support.c   */
+/* GC_do_blocking_inner() is nearly the same as in pthread_support.c    */
 /*ARGSUSED*/
 void GC_do_blocking_inner(ptr_t data, void * context) {
     struct blocking_data * d = (struct blocking_data *) data;
@@ -744,59 +744,59 @@ void GC_do_blocking_inner(ptr_t data, void * context) {
     me = GC_lookup_thread_inner(t);
     GC_ASSERT(me -> thread_blocked_sp == NULL);
 #   ifdef IA64
-       me -> backing_store_ptr = GC_save_regs_in_stack();
+        me -> backing_store_ptr = GC_save_regs_in_stack();
 #   endif
     me -> thread_blocked_sp = (ptr_t) &d; /* save approx. sp */
     /* Save context here if we want to support precise stack marking */
     UNLOCK();
     d -> client_data = (d -> fn)(d -> client_data);
-    LOCK();   /* This will block if the world is stopped.      */
+    LOCK();   /* This will block if the world is stopped.       */
     me -> thread_blocked_sp = NULL;
     UNLOCK();
 }
 
-/* GC_call_with_gc_active() has the opposite to GC_do_blocking()       */
-/* functionality.  It might be called from a user function invoked by  */
-/* GC_do_blocking() to temporarily back allow calling any GC function  */
-/* and/or manipulating pointers to the garbage collected heap.         */
+/* GC_call_with_gc_active() has the opposite to GC_do_blocking()        */
+/* functionality.  It might be called from a user function invoked by   */
+/* GC_do_blocking() to temporarily back allow calling any GC function   */
+/* and/or manipulating pointers to the garbage collected heap.          */
 GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
-                                       void * client_data) {
+                                        void * client_data) {
     struct GC_activation_frame_s frame;
     GC_thread me;
-    LOCK();   /* This will block if the world is stopped.      */
+    LOCK();   /* This will block if the world is stopped.       */
     me = GC_lookup_thread_inner(GetCurrentThreadId());
 
-    /* Adjust our stack base value (this could happen unless   */
-    /* GC_get_stack_base() was used which returned GC_SUCCESS).        */
+    /* Adjust our stack base value (this could happen unless    */
+    /* GC_get_stack_base() was used which returned GC_SUCCESS). */
     GC_ASSERT(me -> stack_base != NULL);
     if (me -> stack_base < (ptr_t)(&frame))
       me -> stack_base = (ptr_t)(&frame);
 
     if (me -> thread_blocked_sp == NULL) {
-      /* We are not inside GC_do_blocking() - do nothing more. */
+      /* We are not inside GC_do_blocking() - do nothing more.  */
       UNLOCK();
       return fn(client_data);
     }
 
-    /* Setup new "frame".      */
+    /* Setup new "frame".       */
     frame.saved_stack_ptr = me -> thread_blocked_sp;
 #   ifdef IA64
-      /* This is the same as in GC_call_with_stack_base().     */
+      /* This is the same as in GC_call_with_stack_base().      */
       frame.backing_store_end = GC_save_regs_in_stack();
-      /* Unnecessarily flushes register stack,                 */
-      /* but that probably doesn't hurt.               */
+      /* Unnecessarily flushes register stack,          */
+      /* but that probably doesn't hurt.                */
       frame.saved_backing_store_ptr = me -> backing_store_ptr;
 #   endif
     frame.prev = me -> activation_frame;
     me -> thread_blocked_sp = NULL;
     me -> activation_frame = &frame;
-    
+
     UNLOCK();
     client_data = fn(client_data);
     GC_ASSERT(me -> thread_blocked_sp == NULL);
     GC_ASSERT(me -> activation_frame == &frame);
 
-    /* Restore original "frame".       */
+    /* Restore original "frame".        */
     LOCK();
     me -> activation_frame = frame.prev;
 #   ifdef IA64
@@ -810,23 +810,23 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
 
 #ifdef GC_PTHREADS
 
-/* A quick-and-dirty cache of the mapping between pthread_t    */
-/* and win32 thread id.                                                */
+/* A quick-and-dirty cache of the mapping between pthread_t     */
+/* and win32 thread id.                                         */
 #define PTHREAD_MAP_SIZE 512
 DWORD GC_pthread_map_cache[PTHREAD_MAP_SIZE];
 #define HASH(pthread_id) ((NUMERIC_THREAD_ID(pthread_id) >> 5) % PTHREAD_MAP_SIZE)
-       /* It appears pthread_t is really a pointer type ... */
+        /* It appears pthread_t is really a pointer type ... */
 #define SET_PTHREAD_MAP_CACHE(pthread_id, win32_id) \
-       (GC_pthread_map_cache[HASH(pthread_id)] = (win32_id))
+        (GC_pthread_map_cache[HASH(pthread_id)] = (win32_id))
 #define GET_PTHREAD_MAP_CACHE(pthread_id) \
-       GC_pthread_map_cache[HASH(pthread_id)]
-
-/* Return a GC_thread corresponding to a given pthread_t.      */
-/* Returns 0 if it's not there.                                        */
-/* We assume that this is only called for pthread ids that     */
-/* have not yet terminated or are still joinable, and          */
-/* cannot be concurrently terminated.                          */
-/* Assumes we do NOT hold the allocation lock.                 */
+        GC_pthread_map_cache[HASH(pthread_id)]
+
+/* Return a GC_thread corresponding to a given pthread_t.       */
+/* Returns 0 if it's not there.                                 */
+/* We assume that this is only called for pthread ids that      */
+/* have not yet terminated or are still joinable, and           */
+/* cannot be concurrently terminated.                           */
+/* Assumes we do NOT hold the allocation lock.                  */
 static GC_thread GC_lookup_pthread(pthread_t id)
 {
 #ifndef GC_NO_DLLMAIN
@@ -837,7 +837,7 @@ static GC_thread GC_lookup_pthread(pthread_t id)
     for (i = 0;
          i <= my_max &&
          (!AO_load_acquire(&(dll_thread_table[i].in_use))
-         || THREAD_EQUAL(dll_thread_table[i].pthread_id, id));
+          || THREAD_EQUAL(dll_thread_table[i].pthread_id, id));
        /* Must still be in_use, since nobody else can store our thread_id. */
        i++);
     if (i > my_max) return 0;
@@ -845,8 +845,8 @@ static GC_thread GC_lookup_pthread(pthread_t id)
   }
 #endif
   {
-    /* We first try the cache.  If that fails, we use a very slow      */
-    /* approach.                                                       */
+    /* We first try the cache.  If that fails, we use a very slow       */
+    /* approach.                                                        */
     int hv_guess = GET_PTHREAD_MAP_CACHE(id) % THREAD_TABLE_SZ;
     int hv;
     GC_thread p;
@@ -854,12 +854,12 @@ static GC_thread GC_lookup_pthread(pthread_t id)
     LOCK();
     for (p = GC_threads[hv_guess]; 0 != p; p = p -> next) {
       if (THREAD_EQUAL(p -> pthread_id, id))
-       goto foundit; 
+        goto foundit;
     }
     for (hv = 0; hv < THREAD_TABLE_SZ; ++hv) {
       for (p = GC_threads[hv]; 0 != p; p = p -> next) {
         if (THREAD_EQUAL(p -> pthread_id, id))
-         goto foundit; 
+          goto foundit;
       }
     }
     p = 0;
@@ -876,16 +876,16 @@ void GC_push_thread_structures(void)
   GC_ASSERT(I_HOLD_LOCK());
 #ifndef GC_NO_DLLMAIN
   if (GC_win32_dll_threads) {
-    /* Unlike the other threads implementations, the thread table here */
-    /* contains no pointers to the collectable heap.  Thus we have     */
-    /* no private structures we need to preserve.                      */
-#   ifdef GC_PTHREADS 
+    /* Unlike the other threads implementations, the thread table here  */
+    /* contains no pointers to the collectable heap.  Thus we have      */
+    /* no private structures we need to preserve.                       */
+#   ifdef GC_PTHREADS
     { int i; /* pthreads may keep a pointer in the thread exit value */
       LONG my_max = GC_get_max_thread_index();
 
       for (i = 0; i <= my_max; i++)
         if (dll_thread_table[i].in_use)
-         GC_push_all((ptr_t)&(dll_thread_table[i].status),
+          GC_push_all((ptr_t)&(dll_thread_table[i].status),
                       (ptr_t)(&(dll_thread_table[i].status)+1));
     }
 #   endif
@@ -897,7 +897,7 @@ void GC_push_thread_structures(void)
 # if defined(THREAD_LOCAL_ALLOC)
     GC_push_all((ptr_t)(&GC_thread_key),
       (ptr_t)(&GC_thread_key)+sizeof(&GC_thread_key));
-    /* Just in case we ever use our own TLS implementation.    */
+    /* Just in case we ever use our own TLS implementation.     */
 # endif
 }
 
@@ -906,41 +906,41 @@ void GC_push_thread_structures(void)
   extern volatile AO_TS_t GC_fault_handler_lock;  /* from os_dep.c */
 #endif
 
-/* Suspend the given thread, if it's still active.     */
+/* Suspend the given thread, if it's still active.      */
 STATIC void GC_suspend(GC_thread t)
 {
 # ifndef MSWINCE
-    /* Apparently the Windows 95 GetOpenFileName call creates          */
-    /* a thread that does not properly get cleaned up, and             */
-    /* SuspendThread on its descriptor may provoke a crash.            */
-    /* This reduces the probability of that event, though it still     */
-    /* appears there's a race here.                                    */
-    DWORD exitCode; 
+    /* Apparently the Windows 95 GetOpenFileName call creates           */
+    /* a thread that does not properly get cleaned up, and              */
+    /* SuspendThread on its descriptor may provoke a crash.             */
+    /* This reduces the probability of that event, though it still      */
+    /* appears there's a race here.                                     */
+    DWORD exitCode;
 # endif
   UNPROTECT(t);
 # ifndef MSWINCE
     if (GetExitCodeThread(t -> handle, &exitCode) &&
         exitCode != STILL_ACTIVE) {
 #     ifdef GC_PTHREADS
-       t -> stack_base = 0; /* prevent stack from being pushed */
+        t -> stack_base = 0; /* prevent stack from being pushed */
 #     else
         /* this breaks pthread_join on Cygwin, which is guaranteed to  */
-        /* only see user pthreads                                     */
-       GC_ASSERT(GC_win32_dll_threads);
-       GC_delete_gc_thread(t);
+        /* only see user pthreads                                      */
+        GC_ASSERT(GC_win32_dll_threads);
+        GC_delete_gc_thread(t);
 #     endif
       return;
     }
 # endif
 # if defined(MPROTECT_VDB)
-    /* Acquire the spin lock we use to update dirty bits.      */
-    /* Threads shouldn't get stopped holding it.  But we may   */
-    /* acquire and release it in the UNPROTECT call.           */
+    /* Acquire the spin lock we use to update dirty bits.       */
+    /* Threads shouldn't get stopped holding it.  But we may    */
+    /* acquire and release it in the UNPROTECT call.            */
     while (AO_test_and_set_acquire(&GC_fault_handler_lock) == AO_TS_SET) {}
 # endif
 
 # ifdef MSWINCE
-    /* SuspendThread() will fail if thread is running kernel code.     */
+    /* SuspendThread() will fail if thread is running kernel code.      */
     while (SuspendThread(THREAD_HANDLE(t)) == (DWORD)-1)
       Sleep(10); /* in millis */
 # else
@@ -984,15 +984,15 @@ void GC_stop_world(void)
     int my_max;
     /* Any threads being created during this loop will end up setting   */
     /* GC_attached_thread when they start.  This will force marking to  */
-    /* restart.                                                                */
-    /* This is not ideal, but hopefully correct.                       */
+    /* restart.                                                         */
+    /* This is not ideal, but hopefully correct.                        */
     GC_attached_thread = FALSE;
     my_max = (int)GC_get_max_thread_index();
     for (i = 0; i <= my_max; i++) {
       GC_vthread t = dll_thread_table + i;
       if (t -> stack_base != 0 && t -> thread_blocked_sp == NULL
-         && t -> id != thread_id) {
-         GC_suspend((GC_thread)t);
+          && t -> id != thread_id) {
+          GC_suspend((GC_thread)t);
       }
     }
   } else
@@ -1003,17 +1003,17 @@ void GC_stop_world(void)
 
       for (i = 0; i < THREAD_TABLE_SZ; i++) {
         for (t = GC_threads[i]; t != 0; t = t -> next) {
-         if (t -> stack_base != 0 && t -> thread_blocked_sp == NULL
-         && !KNOWN_FINISHED(t)
-         && t -> id != thread_id) {
-           GC_suspend(t);
-         }
-       }
+          if (t -> stack_base != 0 && t -> thread_blocked_sp == NULL
+          && !KNOWN_FINISHED(t)
+          && t -> id != thread_id) {
+            GC_suspend(t);
+          }
+        }
       }
   }
 # ifndef CYGWIN32
     LeaveCriticalSection(&GC_write_cs);
-# endif    
+# endif
 # ifdef PARALLEL_MARK
     if (GC_parallel)
       GC_release_mark_lock();
@@ -1031,9 +1031,9 @@ void GC_start_world(void)
     for (i = 0; i <= my_max; i++) {
       GC_thread t = (GC_thread)(dll_thread_table + i);
       if (t -> stack_base != 0 && t -> suspended
-         && t -> id != thread_id) {
+          && t -> id != thread_id) {
         if (ResumeThread(THREAD_HANDLE(t)) == (DWORD)-1)
-         ABORT("ResumeThread failed");
+          ABORT("ResumeThread failed");
         t -> suspended = FALSE;
       }
     }
@@ -1044,10 +1044,10 @@ void GC_start_world(void)
     for (i = 0; i < THREAD_TABLE_SZ; i++) {
       for (t = GC_threads[i]; t != 0; t = t -> next) {
         if (t -> stack_base != 0 && t -> suspended
-           && t -> id != thread_id) {
+            && t -> id != thread_id) {
           if (ResumeThread(THREAD_HANDLE(t)) == (DWORD)-1)
-           ABORT("ResumeThread failed");
-         UNPROTECT(t);
+            ABORT("ResumeThread failed");
+          UNPROTECT(t);
           t -> suspended = FALSE;
         }
       }
@@ -1057,51 +1057,51 @@ void GC_start_world(void)
 }
 
 # ifdef MSWINCE
-    /* The VirtualQuery calls below won't work properly on WinCE, but  */
-    /* since each stack is restricted to an aligned 64K region of      */
-    /* virtual memory we can just take the next lowest multiple of 64K.        */
+    /* The VirtualQuery calls below won't work properly on WinCE, but   */
+    /* since each stack is restricted to an aligned 64K region of       */
+    /* virtual memory we can just take the next lowest multiple of 64K. */
 #   define GC_get_stack_min(s) \
         ((ptr_t)(((DWORD)(s) - 1) & 0xFFFF0000))
 # else
 
-    /* A cache holding the results of the last VirtualQuery call.      */
-    /* Protected by the allocation lock.                               */
+    /* A cache holding the results of the last VirtualQuery call.       */
+    /* Protected by the allocation lock.                                */
     static ptr_t last_address = 0;
     static MEMORY_BASIC_INFORMATION last_info;
 
-    /* Probe stack memory region (starting at "s") to find out its     */
-    /* lowest address (i.e. stack top).                                        */
-    /* S must be a mapped address inside the region, NOT the first     */
-    /* unmapped address.                                               */
+    /* Probe stack memory region (starting at "s") to find out its      */
+    /* lowest address (i.e. stack top).                                 */
+    /* S must be a mapped address inside the region, NOT the first      */
+    /* unmapped address.                                                */
     static ptr_t GC_get_stack_min(ptr_t s)
     {
-       ptr_t bottom;
-
-       GC_ASSERT(I_HOLD_LOCK());
-       if (s != last_address) {
-           VirtualQuery(s, &last_info, sizeof(last_info));
-           last_address = s;
-       }
-       do {
-           bottom = last_info.BaseAddress;
-           VirtualQuery(bottom - 1, &last_info, sizeof(last_info));
-           last_address = bottom - 1;
-       } while ((last_info.Protect & PAGE_READWRITE)
-                && !(last_info.Protect & PAGE_GUARD));
-       return(bottom);
+        ptr_t bottom;
+
+        GC_ASSERT(I_HOLD_LOCK());
+        if (s != last_address) {
+            VirtualQuery(s, &last_info, sizeof(last_info));
+            last_address = s;
+        }
+        do {
+            bottom = last_info.BaseAddress;
+            VirtualQuery(bottom - 1, &last_info, sizeof(last_info));
+            last_address = bottom - 1;
+        } while ((last_info.Protect & PAGE_READWRITE)
+                 && !(last_info.Protect & PAGE_GUARD));
+        return(bottom);
     }
 
-    /* Return true if the page at s has protections appropriate        */
-    /* for a stack page.                                       */
+    /* Return true if the page at s has protections appropriate */
+    /* for a stack page.                                        */
     static GC_bool GC_may_be_in_stack(ptr_t s)
     {
-       GC_ASSERT(I_HOLD_LOCK());
-       if (s != last_address) {
-           VirtualQuery(s, &last_info, sizeof(last_info));
-           last_address = s;
-       }
-       return (last_info.Protect & PAGE_READWRITE)
-               && !(last_info.Protect & PAGE_GUARD);
+        GC_ASSERT(I_HOLD_LOCK());
+        if (s != last_address) {
+            VirtualQuery(s, &last_info, sizeof(last_info));
+            last_address = s;
+        }
+        return (last_info.Protect & PAGE_READWRITE)
+                && !(last_info.Protect & PAGE_GUARD);
     }
 # endif
 
@@ -1113,127 +1113,127 @@ STATIC void GC_push_stack_for(GC_thread thread)
 
     if (thread -> stack_base) {
       struct GC_activation_frame_s *activation_frame =
-                                       thread -> activation_frame;
+                                        thread -> activation_frame;
       if (thread -> id == me) {
-       GC_ASSERT(thread -> thread_blocked_sp == NULL);
-       sp = (ptr_t) &dummy;
+        GC_ASSERT(thread -> thread_blocked_sp == NULL);
+        sp = (ptr_t) &dummy;
       } else if ((sp = thread -> thread_blocked_sp) == NULL) {
-               /* Use saved sp value for blocked threads.      */
-       /* For unblocked threads call GetThreadContext().       */
+                /* Use saved sp value for blocked threads.      */
+        /* For unblocked threads call GetThreadContext().       */
         CONTEXT context;
         context.ContextFlags = CONTEXT_INTEGER|CONTEXT_CONTROL;
         if (!GetThreadContext(THREAD_HANDLE(thread), &context))
-         ABORT("GetThreadContext failed");
+          ABORT("GetThreadContext failed");
 
-        /* Push all registers that might point into the heap.  Frame   */
-        /* pointer registers are included in case client code was      */
-        /* compiled with the 'omit frame pointer' optimisation.                */
+        /* Push all registers that might point into the heap.  Frame    */
+        /* pointer registers are included in case client code was       */
+        /* compiled with the 'omit frame pointer' optimisation.         */
 #       define PUSH1(reg) GC_push_one((word)context.reg)
 #       define PUSH2(r1,r2) PUSH1(r1), PUSH1(r2)
 #       define PUSH4(r1,r2,r3,r4) PUSH2(r1,r2), PUSH2(r3,r4)
 #       if defined(I386)
           PUSH4(Edi,Esi,Ebx,Edx), PUSH2(Ecx,Eax), PUSH1(Ebp);
-         sp = (ptr_t)context.Esp;
-#      elif defined(X86_64)
-         PUSH4(Rax,Rcx,Rdx,Rbx); PUSH2(Rbp, Rsi); PUSH1(Rdi);
-         PUSH4(R8, R9, R10, R11); PUSH4(R12, R13, R14, R15);
-         sp = (ptr_t)context.Rsp;
+          sp = (ptr_t)context.Esp;
+#       elif defined(X86_64)
+          PUSH4(Rax,Rcx,Rdx,Rbx); PUSH2(Rbp, Rsi); PUSH1(Rdi);
+          PUSH4(R8, R9, R10, R11); PUSH4(R12, R13, R14, R15);
+          sp = (ptr_t)context.Rsp;
 #       elif defined(ARM32)
-         PUSH4(R0,R1,R2,R3),PUSH4(R4,R5,R6,R7),PUSH4(R8,R9,R10,R11),PUSH1(R12);
-         sp = (ptr_t)context.Sp;
+          PUSH4(R0,R1,R2,R3),PUSH4(R4,R5,R6,R7),PUSH4(R8,R9,R10,R11),PUSH1(R12);
+          sp = (ptr_t)context.Sp;
 #       elif defined(SHx)
-         PUSH4(R0,R1,R2,R3), PUSH4(R4,R5,R6,R7), PUSH4(R8,R9,R10,R11);
-         PUSH2(R12,R13), PUSH1(R14);
-         sp = (ptr_t)context.R15;
+          PUSH4(R0,R1,R2,R3), PUSH4(R4,R5,R6,R7), PUSH4(R8,R9,R10,R11);
+          PUSH2(R12,R13), PUSH1(R14);
+          sp = (ptr_t)context.R15;
 #       elif defined(MIPS)
-         PUSH4(IntAt,IntV0,IntV1,IntA0), PUSH4(IntA1,IntA2,IntA3,IntT0);
-         PUSH4(IntT1,IntT2,IntT3,IntT4), PUSH4(IntT5,IntT6,IntT7,IntS0);
-         PUSH4(IntS1,IntS2,IntS3,IntS4), PUSH4(IntS5,IntS6,IntS7,IntT8);
-         PUSH4(IntT9,IntK0,IntK1,IntS8);
-         sp = (ptr_t)context.IntSp;
+          PUSH4(IntAt,IntV0,IntV1,IntA0), PUSH4(IntA1,IntA2,IntA3,IntT0);
+          PUSH4(IntT1,IntT2,IntT3,IntT4), PUSH4(IntT5,IntT6,IntT7,IntS0);
+          PUSH4(IntS1,IntS2,IntS3,IntS4), PUSH4(IntS5,IntS6,IntS7,IntT8);
+          PUSH4(IntT9,IntK0,IntK1,IntS8);
+          sp = (ptr_t)context.IntSp;
 #       elif defined(PPC)
-         PUSH4(Gpr0, Gpr3, Gpr4, Gpr5),  PUSH4(Gpr6, Gpr7, Gpr8, Gpr9);
-         PUSH4(Gpr10,Gpr11,Gpr12,Gpr14), PUSH4(Gpr15,Gpr16,Gpr17,Gpr18);
-         PUSH4(Gpr19,Gpr20,Gpr21,Gpr22), PUSH4(Gpr23,Gpr24,Gpr25,Gpr26);
-         PUSH4(Gpr27,Gpr28,Gpr29,Gpr30), PUSH1(Gpr31);
-         sp = (ptr_t)context.Gpr1;
+          PUSH4(Gpr0, Gpr3, Gpr4, Gpr5),  PUSH4(Gpr6, Gpr7, Gpr8, Gpr9);
+          PUSH4(Gpr10,Gpr11,Gpr12,Gpr14), PUSH4(Gpr15,Gpr16,Gpr17,Gpr18);
+          PUSH4(Gpr19,Gpr20,Gpr21,Gpr22), PUSH4(Gpr23,Gpr24,Gpr25,Gpr26);
+          PUSH4(Gpr27,Gpr28,Gpr29,Gpr30), PUSH1(Gpr31);
+          sp = (ptr_t)context.Gpr1;
 #       elif defined(ALPHA)
-         PUSH4(IntV0,IntT0,IntT1,IntT2), PUSH4(IntT3,IntT4,IntT5,IntT6);
-         PUSH4(IntT7,IntS0,IntS1,IntS2), PUSH4(IntS3,IntS4,IntS5,IntFp);
-         PUSH4(IntA0,IntA1,IntA2,IntA3), PUSH4(IntA4,IntA5,IntT8,IntT9);
-         PUSH4(IntT10,IntT11,IntT12,IntAt);
-         sp = (ptr_t)context.IntSp;
+          PUSH4(IntV0,IntT0,IntT1,IntT2), PUSH4(IntT3,IntT4,IntT5,IntT6);
+          PUSH4(IntT7,IntS0,IntS1,IntS2), PUSH4(IntS3,IntS4,IntS5,IntFp);
+          PUSH4(IntA0,IntA1,IntA2,IntA3), PUSH4(IntA4,IntA5,IntT8,IntT9);
+          PUSH4(IntT10,IntT11,IntT12,IntAt);
+          sp = (ptr_t)context.IntSp;
 #       else
 #         error "architecture is not supported"
 #       endif
       } /* ! current thread */
 
-      /* Set stack_min to the lowest address in the thread stack,      */
-      /* or to an address in the thread stack no larger than sp,       */
-      /* taking advantage of the old value to avoid slow traversals    */
-      /* of large stacks.                                              */
+      /* Set stack_min to the lowest address in the thread stack,       */
+      /* or to an address in the thread stack no larger than sp,        */
+      /* taking advantage of the old value to avoid slow traversals     */
+      /* of large stacks.                                               */
       if (thread -> last_stack_min == ADDR_LIMIT) {
-       stack_min = GC_get_stack_min(activation_frame != NULL ?
-                       (ptr_t)activation_frame : thread -> stack_base);
+        stack_min = GC_get_stack_min(activation_frame != NULL ?
+                        (ptr_t)activation_frame : thread -> stack_base);
         UNPROTECT(thread);
         thread -> last_stack_min = stack_min;
       } else {
-       /* First, adjust the latest known minimum stack address if we   */
-       /* are inside GC_call_with_gc_active().                         */
-       if (activation_frame != NULL &&
-           thread -> last_stack_min > (ptr_t)activation_frame) {
+        /* First, adjust the latest known minimum stack address if we   */
+        /* are inside GC_call_with_gc_active().                         */
+        if (activation_frame != NULL &&
+            thread -> last_stack_min > (ptr_t)activation_frame) {
           UNPROTECT(thread);
-         thread -> last_stack_min = (ptr_t)activation_frame;
-       }
+          thread -> last_stack_min = (ptr_t)activation_frame;
+        }
 
-       if (sp < thread -> stack_base && sp >= thread -> last_stack_min) {
-           stack_min = sp;
-       } else {
+        if (sp < thread -> stack_base && sp >= thread -> last_stack_min) {
+            stack_min = sp;
+        } else {
 #         ifdef MSWINCE
-           stack_min = GC_get_stack_min(activation_frame != NULL ?
-                         (ptr_t)activation_frame : thread -> stack_base);
+            stack_min = GC_get_stack_min(activation_frame != NULL ?
+                          (ptr_t)activation_frame : thread -> stack_base);
 #         else
-           /* In the current thread it is always safe to use sp value. */
-           if (GC_may_be_in_stack(thread -> id == me &&
-                                sp < thread -> last_stack_min ?
-                                sp : thread -> last_stack_min)) {
-             stack_min = last_info.BaseAddress;
-             /* Do not probe rest of the stack if sp is correct. */
-             if (sp < stack_min || sp >= thread->stack_base)
-               stack_min = GC_get_stack_min(thread -> last_stack_min);
-           } else {
-             /* Stack shrunk?  Is this possible? */
-             stack_min = GC_get_stack_min(thread -> stack_base);
-           }
-#        endif
+            /* In the current thread it is always safe to use sp value. */
+            if (GC_may_be_in_stack(thread -> id == me &&
+                                 sp < thread -> last_stack_min ?
+                                 sp : thread -> last_stack_min)) {
+              stack_min = last_info.BaseAddress;
+              /* Do not probe rest of the stack if sp is correct. */
+              if (sp < stack_min || sp >= thread->stack_base)
+                stack_min = GC_get_stack_min(thread -> last_stack_min);
+            } else {
+              /* Stack shrunk?  Is this possible? */
+              stack_min = GC_get_stack_min(thread -> stack_base);
+            }
+#         endif
           UNPROTECT(thread);
           thread -> last_stack_min = stack_min;
-       }
+        }
       }
       GC_ASSERT(stack_min == GC_get_stack_min(thread -> stack_base)
-               || (sp >= stack_min && stack_min < thread -> stack_base
-                  && stack_min > GC_get_stack_min(thread -> stack_base)));
+                || (sp >= stack_min && stack_min < thread -> stack_base
+                   && stack_min > GC_get_stack_min(thread -> stack_base)));
 
       if (sp >= stack_min && sp < thread->stack_base) {
 #       ifdef DEBUG_THREADS
-         GC_printf("Pushing stack for 0x%x from sp %p to %p from 0x%x\n",
-                   (int)thread -> id, sp, thread -> stack_base, (int)me);
+          GC_printf("Pushing stack for 0x%x from sp %p to %p from 0x%x\n",
+                    (int)thread -> id, sp, thread -> stack_base, (int)me);
 #       endif
-       GC_push_all_stack_frames(sp, thread->stack_base, activation_frame);
+        GC_push_all_stack_frames(sp, thread->stack_base, activation_frame);
       } else {
-       /* If not current thread then it is possible for sp to point to */
-       /* the guarded (untouched yet) page just below the current      */
-       /* stack_min of the thread.                                     */
-       if (thread -> id == me || sp >= thread->stack_base
-               || sp + GC_page_size < stack_min)
-         WARN("Thread stack pointer %p out of range, pushing everything\n",
-               sp);
+        /* If not current thread then it is possible for sp to point to */
+        /* the guarded (untouched yet) page just below the current      */
+        /* stack_min of the thread.                                     */
+        if (thread -> id == me || sp >= thread->stack_base
+                || sp + GC_page_size < stack_min)
+          WARN("Thread stack pointer %p out of range, pushing everything\n",
+                sp);
 #       ifdef DEBUG_THREADS
-         GC_printf("Pushing stack for 0x%x from (min) %p to %p from 0x%x\n",
-                   (int)thread -> id, stack_min,
-                   thread -> stack_base, (int)me);
+          GC_printf("Pushing stack for 0x%x from (min) %p to %p from 0x%x\n",
+                    (int)thread -> id, stack_min,
+                    thread -> stack_base, (int)me);
 #       endif
-       /* Push everything - ignore activation "frames" data.           */
+        /* Push everything - ignore activation "frames" data.           */
         GC_push_all_stack(stack_min, thread->stack_base);
       }
     } /* thread looks live */
@@ -1254,9 +1254,9 @@ void GC_push_all_stacks(void)
     for (i = 0; i <= my_max; i++) {
       GC_thread t = (GC_thread)(dll_thread_table + i);
       if (t -> in_use) {
-#      ifndef SMALL_CONFIG
-         ++nthreads;
-#      endif
+#       ifndef SMALL_CONFIG
+          ++nthreads;
+#       endif
         GC_push_stack_for(t);
         if (t -> id == me) found_me = TRUE;
       }
@@ -1269,9 +1269,9 @@ void GC_push_all_stacks(void)
 
     for (i = 0; i < THREAD_TABLE_SZ; i++) {
       for (t = GC_threads[i]; t != 0; t = t -> next) {
-#      ifndef SMALL_CONFIG
-         ++nthreads;
-#      endif
+#       ifndef SMALL_CONFIG
+          ++nthreads;
+#       endif
         if (!KNOWN_FINISHED(t)) GC_push_stack_for(t);
         if (t -> id == me) found_me = TRUE;
       }
@@ -1280,7 +1280,7 @@ void GC_push_all_stacks(void)
 # ifndef SMALL_CONFIG
     if (GC_print_stats == VERBOSE) {
       GC_log_printf("Pushed %d thread stacks%s\n", nthreads,
-            GC_win32_dll_threads ? " based on DllMain thread tracking" : "");
+             GC_win32_dll_threads ? " based on DllMain thread tracking" : "");
     }
 # endif
   if (!found_me && !GC_in_thread_creation)
@@ -1293,89 +1293,89 @@ void GC_push_all_stacks(void)
 #   define MAX_MARKERS 16
 # endif
 
-  extern long GC_markers;      /* Number of mark threads we would      */
-                               /* like to have.  Includes the          */
-                               /* initiating thread.                   */
+  extern long GC_markers;       /* Number of mark threads we would      */
+                                /* like to have.  Includes the          */
+                                /* initiating thread.                   */
 
-  static ptr_t marker_sp[MAX_MARKERS - 1]; /* The cold end of the stack        */
-                                          /* for markers.              */
+  static ptr_t marker_sp[MAX_MARKERS - 1]; /* The cold end of the stack */
+                                           /* for markers.              */
 # ifdef IA64
     static ptr_t marker_bsp[MAX_MARKERS - 1];
 # endif
 
   static ptr_t marker_last_stack_min[MAX_MARKERS - 1];
-                               /* Last known minimum (hottest) address */
-                               /* in stack (or ADDR_LIMIT if unset)    */
-                               /* for markers.                         */
+                                /* Last known minimum (hottest) address */
+                                /* in stack (or ADDR_LIMIT if unset)    */
+                                /* for markers.                         */
 
 #endif
 
-/* Find stack with the lowest address which overlaps the       */
-/* interval [start, limit).                                    */
-/* Return stack bounds in *lo and *hi.  If no such stack       */
-/* is found, both *hi and *lo will be set to an address        */
-/* higher than limit.                                          */
+/* Find stack with the lowest address which overlaps the        */
+/* interval [start, limit).                                     */
+/* Return stack bounds in *lo and *hi.  If no such stack        */
+/* is found, both *hi and *lo will be set to an address         */
+/* higher than limit.                                           */
 void GC_get_next_stack(char *start, char *limit,
-                      char **lo, char **hi)
+                       char **lo, char **hi)
 {
     int i;
-    char * current_min = ADDR_LIMIT;  /* Least in-range stack base     */
-    ptr_t *plast_stack_min = NULL;    /* Address of last_stack_min     */
-                                     /* field for thread corresponding */
-                                     /* to current_min.                */
-    GC_thread thread = NULL;         /* Either NULL or points to the   */
-                                     /* thread's hash table entry      */
-                                     /* containing *plast_stack_min.   */
+    char * current_min = ADDR_LIMIT;  /* Least in-range stack base      */
+    ptr_t *plast_stack_min = NULL;    /* Address of last_stack_min      */
+                                      /* field for thread corresponding */
+                                      /* to current_min.                */
+    GC_thread thread = NULL;          /* Either NULL or points to the   */
+                                      /* thread's hash table entry      */
+                                      /* containing *plast_stack_min.   */
 
     /* First set current_min, ignoring limit. */
       if (GC_win32_dll_threads) {
         LONG my_max = GC_get_max_thread_index();
-  
+
         for (i = 0; i <= my_max; i++) {
-         ptr_t s = (ptr_t)(dll_thread_table[i].stack_base);
-
-         if (s > start && s < current_min) {
-           /* Update address of last_stack_min. */
-           plast_stack_min = (ptr_t * /* no volatile */)
-                               &dll_thread_table[i].last_stack_min;
-           current_min = s;
-         }
+          ptr_t s = (ptr_t)(dll_thread_table[i].stack_base);
+
+          if (s > start && s < current_min) {
+            /* Update address of last_stack_min. */
+            plast_stack_min = (ptr_t * /* no volatile */)
+                                &dll_thread_table[i].last_stack_min;
+            current_min = s;
+          }
         }
       } else {
         for (i = 0; i < THREAD_TABLE_SZ; i++) {
-         GC_thread t;
+          GC_thread t;
 
           for (t = GC_threads[i]; t != 0; t = t -> next) {
-           ptr_t s = t -> stack_base;
-
-           if (s > start && s < current_min) {
-             /* Update address of last_stack_min. */
-             plast_stack_min = &t -> last_stack_min;
-             thread = t; /* Remember current thread to unprotect. */
-             current_min = s;
-           }
+            ptr_t s = t -> stack_base;
+
+            if (s > start && s < current_min) {
+              /* Update address of last_stack_min. */
+              plast_stack_min = &t -> last_stack_min;
+              thread = t; /* Remember current thread to unprotect. */
+              current_min = s;
+            }
           }
         }
-#      ifdef PARALLEL_MARK
-         for (i = 0; i < GC_markers - 1; ++i) {
-           ptr_t s = marker_sp[i];
-#          ifdef IA64
-               /* FIXME: not implemented */
-#          endif
-           if (s > start && s < current_min) {
-             GC_ASSERT(marker_last_stack_min[i] != NULL);
-             plast_stack_min = &marker_last_stack_min[i];
-             current_min = s;
-             thread = NULL; /* Not a thread's hash table entry. */
-           }
-         }
-#      endif
+#       ifdef PARALLEL_MARK
+          for (i = 0; i < GC_markers - 1; ++i) {
+            ptr_t s = marker_sp[i];
+#           ifdef IA64
+                /* FIXME: not implemented */
+#           endif
+            if (s > start && s < current_min) {
+              GC_ASSERT(marker_last_stack_min[i] != NULL);
+              plast_stack_min = &marker_last_stack_min[i];
+              current_min = s;
+              thread = NULL; /* Not a thread's hash table entry. */
+            }
+          }
+#       endif
       }
 
     *hi = current_min;
     if (current_min == ADDR_LIMIT) {
-       *lo = ADDR_LIMIT;
-       return;
+        *lo = ADDR_LIMIT;
+        return;
     }
 
     GC_ASSERT(current_min > start);
@@ -1383,30 +1383,30 @@ void GC_get_next_stack(char *start, char *limit,
 #   ifndef MSWINCE
       if (current_min > limit && !GC_may_be_in_stack(limit)) {
         /* Skip the rest since the memory region at limit address is    */
-       /* not a stack (so the lowest address of the found stack would  */
-       /* be above the limit value anyway).                            */
+        /* not a stack (so the lowest address of the found stack would  */
+        /* be above the limit value anyway).                            */
         *lo = ADDR_LIMIT;
         return;
       }
 #   endif
-    
-    /* Get the minimum address of the found stack by probing its memory        */
-    /* region starting from the last known minimum (if set).           */
+
+    /* Get the minimum address of the found stack by probing its memory */
+    /* region starting from the last known minimum (if set).            */
       if (*plast_stack_min == ADDR_LIMIT
-#       ifndef MSWINCE
-          || !GC_may_be_in_stack(*plast_stack_min)
-#       endif
+#        ifndef MSWINCE
+           || !GC_may_be_in_stack(*plast_stack_min)
+#        endif
          ) {
-        /* Unsafe to start from last value.    */
+        /* Unsafe to start from last value.     */
         *lo = GC_get_stack_min(current_min);
       } else {
         /* Use last value value to optimize search for min address */
-       *lo = GC_get_stack_min(*plast_stack_min);
+        *lo = GC_get_stack_min(*plast_stack_min);
       }
 
     /* Remember current stack_min value. */
       if (thread != NULL) {
-       UNPROTECT(thread);
+        UNPROTECT(thread);
       }
       *plast_stack_min = *lo;
 }
@@ -1414,11 +1414,11 @@ void GC_get_next_stack(char *start, char *limit,
 #ifdef PARALLEL_MARK
 
 #if defined(GC_PTHREADS) && !defined(GC_PTHREADS_PARAMARK)
-  /* Use pthread-based parallel mark implementation.   */
+  /* Use pthread-based parallel mark implementation.    */
 # define GC_PTHREADS_PARAMARK
 #endif
 
-  /* GC_mark_thread() is the same as in pthread_support.c      */
+  /* GC_mark_thread() is the same as in pthread_support.c       */
 #ifdef GC_PTHREADS_PARAMARK
   STATIC void * GC_mark_thread(void * id)
 #else
@@ -1440,13 +1440,13 @@ void GC_get_next_stack(char *start, char *limit,
 
   for (;; ++my_mark_no) {
     if (my_mark_no - GC_mark_no > (word)2) {
-       /* resynchronize if we get far off, e.g. because GC_mark_no     */
-       /* wrapped.                                                     */
-       my_mark_no = GC_mark_no;
+        /* resynchronize if we get far off, e.g. because GC_mark_no     */
+        /* wrapped.                                                     */
+        my_mark_no = GC_mark_no;
     }
 #   ifdef DEBUG_THREADS
-       GC_printf("Starting mark helper for mark number %lu\n",
-               (unsigned long)my_mark_no);
+        GC_printf("Starting mark helper for mark number %lu\n",
+                (unsigned long)my_mark_no);
 #   endif
     GC_help_marker(my_mark_no);
   }
@@ -1465,10 +1465,10 @@ void GC_get_next_stack(char *start, char *limit,
 #   define NUMERIC_THREAD_ID(id) (unsigned long)(id.p)
 # endif
 
-/* start_mark_threads() is the same as in pthread_support.c except for:        */
-/* - GC_markers value is adjusted already;                             */
-/* - thread stack is assumed to be large enough; and                   */
-/* - statistics about the number of marker threads is already printed. */
+/* start_mark_threads() is the same as in pthread_support.c except for: */
+/* - GC_markers value is adjusted already;                              */
+/* - thread stack is assumed to be large enough; and                    */
+/* - statistics about the number of marker threads is already printed.  */
 
 static void start_mark_threads(void)
 {
@@ -1477,19 +1477,19 @@ static void start_mark_threads(void)
     pthread_t new_thread;
 
     if (0 != pthread_attr_init(&attr)) ABORT("pthread_attr_init failed");
-       
+
     if (0 != pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
-       ABORT("pthread_attr_setdetachstate failed");
+        ABORT("pthread_attr_setdetachstate failed");
 
     for (i = 0; i < GC_markers - 1; ++i) {
       marker_last_stack_min[i] = ADDR_LIMIT;
       if (0 != pthread_create(&new_thread, &attr,
-                             GC_mark_thread, (void *)(word)i)) {
-       WARN("Marker thread creation failed.\n", 0);
-       /* Don't try to create other marker threads.    */
-       GC_markers = i + 1;
-       if (i == 0) GC_parallel = FALSE;
-       break;
+                              GC_mark_thread, (void *)(word)i)) {
+        WARN("Marker thread creation failed.\n", 0);
+        /* Don't try to create other marker threads.    */
+        GC_markers = i + 1;
+        if (i == 0) GC_parallel = FALSE;
+        break;
       }
     }
     pthread_attr_destroy(&attr);
@@ -1499,9 +1499,9 @@ static pthread_mutex_t mark_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static pthread_cond_t builder_cv = PTHREAD_COND_INITIALIZER;
 
-/* GC_acquire/release_mark_lock(), GC_wait_builder/marker(),           */
-/* GC_wait_for_reclaim(), GC_notify_all_builder/marker() are the same  */
-/* as in pthread_support.c except that GC_generic_lock() is not used.  */
+/* GC_acquire/release_mark_lock(), GC_wait_builder/marker(),            */
+/* GC_wait_for_reclaim(), GC_notify_all_builder/marker() are the same   */
+/* as in pthread_support.c except that GC_generic_lock() is not used.   */
 
 #ifdef LOCK_STATS
   AO_t GC_block_count = 0;
@@ -1510,14 +1510,14 @@ static pthread_cond_t builder_cv = PTHREAD_COND_INITIALIZER;
 void GC_acquire_mark_lock(void)
 {
     if (pthread_mutex_lock(&mark_mutex) != 0) {
-       ABORT("pthread_mutex_lock failed");
+        ABORT("pthread_mutex_lock failed");
     }
 #   ifdef LOCK_STATS
-       (void)AO_fetch_and_add1(&GC_block_count);
+        (void)AO_fetch_and_add1(&GC_block_count);
 #   endif
     /* GC_generic_lock(&mark_mutex); */
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NUMERIC_THREAD_ID(pthread_self());
+        GC_mark_lock_holder = NUMERIC_THREAD_ID(pthread_self());
 #   endif
 }
 
@@ -1525,30 +1525,30 @@ void GC_release_mark_lock(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NO_THREAD;
+        GC_mark_lock_holder = NO_THREAD;
 #   endif
     if (pthread_mutex_unlock(&mark_mutex) != 0) {
-       ABORT("pthread_mutex_unlock failed");
+        ABORT("pthread_mutex_unlock failed");
     }
 }
 
-/* Collector must wait for a freelist builders for 2 reasons:          */
-/* 1) Mark bits may still be getting examined without lock.            */
-/* 2) Partial free lists referenced only by locals may not be scanned  */
-/*    correctly, e.g. if they contain "pointer-free" objects, since the        */
-/*    free-list link may be ignored.                                   */
+/* Collector must wait for a freelist builders for 2 reasons:           */
+/* 1) Mark bits may still be getting examined without lock.             */
+/* 2) Partial free lists referenced only by locals may not be scanned   */
+/*    correctly, e.g. if they contain "pointer-free" objects, since the */
+/*    free-list link may be ignored.                                    */
 STATIC void GC_wait_builder(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NO_THREAD;
+        GC_mark_lock_holder = NO_THREAD;
 #   endif
     if (pthread_cond_wait(&builder_cv, &mark_mutex) != 0) {
-       ABORT("pthread_cond_wait failed");
+        ABORT("pthread_cond_wait failed");
     }
     GC_ASSERT(GC_mark_lock_holder == NO_THREAD);
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NUMERIC_THREAD_ID(pthread_self());
+        GC_mark_lock_holder = NUMERIC_THREAD_ID(pthread_self());
 #   endif
 }
 
@@ -1556,7 +1556,7 @@ void GC_wait_for_reclaim(void)
 {
     GC_acquire_mark_lock();
     while (GC_fl_builder_count > 0) {
-       GC_wait_builder();
+        GC_wait_builder();
     }
     GC_release_mark_lock();
 }
@@ -1565,7 +1565,7 @@ void GC_notify_all_builder(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
     if (pthread_cond_broadcast(&builder_cv) != 0) {
-       ABORT("pthread_cond_broadcast failed");
+        ABORT("pthread_cond_broadcast failed");
     }
 }
 
@@ -1575,21 +1575,21 @@ void GC_wait_marker(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NO_THREAD;
+        GC_mark_lock_holder = NO_THREAD;
 #   endif
     if (pthread_cond_wait(&mark_cv, &mark_mutex) != 0) {
-       ABORT("pthread_cond_wait failed");
+        ABORT("pthread_cond_wait failed");
     }
     GC_ASSERT(GC_mark_lock_holder == NO_THREAD);
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NUMERIC_THREAD_ID(pthread_self());
+        GC_mark_lock_holder = NUMERIC_THREAD_ID(pthread_self());
 #   endif
 }
 
 void GC_notify_all_marker(void)
 {
     if (pthread_cond_broadcast(&mark_cv) != 0) {
-       ABORT("pthread_cond_broadcast failed");
+        ABORT("pthread_cond_broadcast failed");
     }
 }
 
@@ -1597,77 +1597,77 @@ void GC_notify_all_marker(void)
 
 # ifdef DONT_USE_SIGNALANDWAIT
     STATIC HANDLE GC_marker_cv[MAX_MARKERS - 1];
-                       /* Events with manual reset (one for each       */
-                       /* mark helper).                                */
+                        /* Events with manual reset (one for each       */
+                        /* mark helper).                                */
 
     STATIC DWORD GC_marker_Id[MAX_MARKERS - 1];
-                       /* This table is used for mapping helper        */
-                       /* threads ID to mark helper index (linear      */
-                       /* search is used since the mapping contains    */
-                       /* only a few entries).                         */
+                        /* This table is used for mapping helper        */
+                        /* threads ID to mark helper index (linear      */
+                        /* search is used since the mapping contains    */
+                        /* only a few entries).                         */
 # endif
 
 # ifndef MARK_THREAD_STACK_SIZE
-#   define MARK_THREAD_STACK_SIZE 0    /* default value */
+#   define MARK_THREAD_STACK_SIZE 0     /* default value */
 # endif
 
 /* mark_mutex_event, builder_cv, mark_cv are initialized in GC_thr_init(). */
-static HANDLE mark_mutex_event = (HANDLE)0; /* Event with auto-reset.  */
-static HANDLE builder_cv = (HANDLE)0; /* Event with manual reset.      */
-static HANDLE mark_cv = (HANDLE)0; /* Event with manual reset.         */
+static HANDLE mark_mutex_event = (HANDLE)0; /* Event with auto-reset.   */
+static HANDLE builder_cv = (HANDLE)0; /* Event with manual reset.       */
+static HANDLE mark_cv = (HANDLE)0; /* Event with manual reset.          */
 
 static void start_mark_threads(void)
 {
       int i;
 #     ifdef MSWINCE
         HANDLE handle;
-       DWORD thread_id;
+        DWORD thread_id;
 #     else
         GC_uintptr_t handle;
-       unsigned thread_id;
+        unsigned thread_id;
 #     endif
 
 #     ifdef DONT_USE_SIGNALANDWAIT
-       /* Initialize GC_marker_cv[] and GC_marker_Id[] fully before    */
-       /* starting the first helper thread.                            */
-       for (i = 0; i < GC_markers - 1; ++i) {
-         GC_marker_Id[i] = GetCurrentThreadId();
-         if ((GC_marker_cv[i] = CreateEvent(NULL /* attrs */,
-                                       TRUE /* isManualReset */,
-                                       FALSE /* initialState */,
-                                       NULL /* name (A/W) */)) == (HANDLE)0)
-           ABORT("CreateEvent() failed");
-       }
+        /* Initialize GC_marker_cv[] and GC_marker_Id[] fully before    */
+        /* starting the first helper thread.                            */
+        for (i = 0; i < GC_markers - 1; ++i) {
+          GC_marker_Id[i] = GetCurrentThreadId();
+          if ((GC_marker_cv[i] = CreateEvent(NULL /* attrs */,
+                                        TRUE /* isManualReset */,
+                                        FALSE /* initialState */,
+                                        NULL /* name (A/W) */)) == (HANDLE)0)
+            ABORT("CreateEvent() failed");
+        }
 #     endif
 
       for (i = 0; i < GC_markers - 1; ++i) {
-       marker_last_stack_min[i] = ADDR_LIMIT;
-#      ifdef MSWINCE
+        marker_last_stack_min[i] = ADDR_LIMIT;
+#       ifdef MSWINCE
          /* There is no _beginthreadex() in WinCE. */
          handle = CreateThread(NULL /* lpsa */, MARK_THREAD_STACK_SIZE,
                                GC_mark_thread, (LPVOID)(word)i,
                                0 /* fdwCreate */, &thread_id);
-         if (handle == NULL) {
-           WARN("Marker thread creation failed\n", 0);
-           /* The most probable failure reason is "not enough memory". */
-           /* Don't try to create other marker threads.                */
-           break;
-         } else {
-           /* It's safe to detach the thread.  */
-           CloseHandle(handle);
-         }
-#      else
-         handle = _beginthreadex(NULL /* security_attr */,
-                               MARK_THREAD_STACK_SIZE, GC_mark_thread,
-                               (void *)(word)i, 0 /* flags */, &thread_id);
-         if (!handle || handle == (GC_uintptr_t)-1L) {
-           WARN("Marker thread creation failed\n", 0);
-           /* Don't try to create other marker threads.                */
-           break;
-         } else {/* We may detach the thread (if handle is of HANDLE type) */
-           /* CloseHandle((HANDLE)handle); */
-         }
-#      endif
+          if (handle == NULL) {
+            WARN("Marker thread creation failed\n", 0);
+            /* The most probable failure reason is "not enough memory". */
+            /* Don't try to create other marker threads.                */
+            break;
+          } else {
+            /* It's safe to detach the thread.  */
+            CloseHandle(handle);
+          }
+#       else
+          handle = _beginthreadex(NULL /* security_attr */,
+                                MARK_THREAD_STACK_SIZE, GC_mark_thread,
+                                (void *)(word)i, 0 /* flags */, &thread_id);
+          if (!handle || handle == (GC_uintptr_t)-1L) {
+            WARN("Marker thread creation failed\n", 0);
+            /* Don't try to create other marker threads.                */
+            break;
+          } else {/* We may detach the thread (if handle is of HANDLE type) */
+            /* CloseHandle((HANDLE)handle); */
+          }
+#       endif
       }
 
       /* Adjust GC_markers (and free unused resources) in case of failure. */
@@ -1689,13 +1689,13 @@ static void start_mark_threads(void)
 
 #ifdef DONT_USE_SIGNALANDWAIT
   STATIC /* volatile */ LONG GC_mark_mutex_state = 0;
-                               /* Mutex state: 0 - unlocked,           */
-                               /* 1 - locked and no other waiters,     */
-                               /* -1 - locked and waiters may exist.   */
-                               /* Accessed by InterlockedExchange().   */
+                                /* Mutex state: 0 - unlocked,           */
+                                /* 1 - locked and no other waiters,     */
+                                /* -1 - locked and waiters may exist.   */
+                                /* Accessed by InterlockedExchange().   */
 #else
-  volatile AO_t GC_mark_mutex_waitcnt = 0;     /* Number of waiters + 1; */
-                                               /* 0 - unlocked. */
+  volatile AO_t GC_mark_mutex_waitcnt = 0;      /* Number of waiters + 1; */
+                                                /* 0 - unlocked. */
 #endif
 
 /* #define LOCK_STATS */
@@ -1707,33 +1707,33 @@ static void start_mark_threads(void)
 void GC_acquire_mark_lock(void)
 {
 #   ifdef DONT_USE_SIGNALANDWAIT
-       if (InterlockedExchange(&GC_mark_mutex_state, 1 /* locked */) != 0)
+        if (InterlockedExchange(&GC_mark_mutex_state, 1 /* locked */) != 0)
 #   else
-       if (AO_fetch_and_add1_acquire(&GC_mark_mutex_waitcnt) != 0)
+        if (AO_fetch_and_add1_acquire(&GC_mark_mutex_waitcnt) != 0)
 #   endif
     {
-#      ifdef LOCK_STATS
+#       ifdef LOCK_STATS
           (void)AO_fetch_and_add1(&GC_block_count);
-#      endif
-#      ifdef DONT_USE_SIGNALANDWAIT
-           /* Repeatedly reset the state and wait until acquire the lock. */
-           while (InterlockedExchange(&GC_mark_mutex_state,
-                                      -1 /* locked_and_has_waiters */) != 0)
-#      endif
-       {
+#       endif
+#       ifdef DONT_USE_SIGNALANDWAIT
+            /* Repeatedly reset the state and wait until acquire the lock. */
+            while (InterlockedExchange(&GC_mark_mutex_state,
+                                       -1 /* locked_and_has_waiters */) != 0)
+#       endif
+        {
             if (WaitForSingleObject(mark_mutex_event, INFINITE) == WAIT_FAILED)
-               ABORT("WaitForSingleObject() failed");
-       }
+                ABORT("WaitForSingleObject() failed");
+        }
     }
 #   ifdef LOCK_STATS
         else {
-         (void)AO_fetch_and_add1(&GC_unlocked_count);
-       }
+          (void)AO_fetch_and_add1(&GC_unlocked_count);
+        }
 #   endif
-  
+
     GC_ASSERT(GC_mark_lock_holder == NO_THREAD);
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = (unsigned long)GetCurrentThreadId();
+        GC_mark_lock_holder = (unsigned long)GetCurrentThreadId();
 #   endif
 }
 
@@ -1741,40 +1741,40 @@ void GC_release_mark_lock(void)
 {
     GC_ASSERT(GC_mark_lock_holder == (unsigned long)GetCurrentThreadId());
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NO_THREAD;
+        GC_mark_lock_holder = NO_THREAD;
 #   endif
 #   ifdef DONT_USE_SIGNALANDWAIT
-       if (InterlockedExchange(&GC_mark_mutex_state, 0 /* unlocked */) < 0)
+        if (InterlockedExchange(&GC_mark_mutex_state, 0 /* unlocked */) < 0)
 #   else
-       GC_ASSERT(AO_load(&GC_mark_mutex_waitcnt) != 0);
-       if (AO_fetch_and_sub1_release(&GC_mark_mutex_waitcnt) > 1)
+        GC_ASSERT(AO_load(&GC_mark_mutex_waitcnt) != 0);
+        if (AO_fetch_and_sub1_release(&GC_mark_mutex_waitcnt) > 1)
 #   endif
-       {
-           /* wake a waiter */
-           if (SetEvent(mark_mutex_event) == FALSE)
-               ABORT("SetEvent() failed");
-       }
+        {
+            /* wake a waiter */
+            if (SetEvent(mark_mutex_event) == FALSE)
+                ABORT("SetEvent() failed");
+        }
 }
 
-/* In GC_wait_for_reclaim/GC_notify_all_builder() we emulate POSIX     */
-/* cond_wait/cond_broadcast() primitives with WinAPI Event object      */
-/* (working in "manual reset" mode).  This works here because          */
-/* GC_notify_all_builder() is always called holding lock on            */
-/* mark_mutex and the checked condition (GC_fl_builder_count == 0)     */
-/* is the only one for which broadcasting on builder_cv is performed.  */
+/* In GC_wait_for_reclaim/GC_notify_all_builder() we emulate POSIX      */
+/* cond_wait/cond_broadcast() primitives with WinAPI Event object       */
+/* (working in "manual reset" mode).  This works here because           */
+/* GC_notify_all_builder() is always called holding lock on             */
+/* mark_mutex and the checked condition (GC_fl_builder_count == 0)      */
+/* is the only one for which broadcasting on builder_cv is performed.   */
 
 void GC_wait_for_reclaim(void)
 {
     GC_ASSERT(builder_cv != 0);
     for (;;) {
-       GC_acquire_mark_lock();
-       if (GC_fl_builder_count == 0)
-           break;
-       if (ResetEvent(builder_cv) == FALSE)
-           ABORT("ResetEvent() failed");
-       GC_release_mark_lock();
-       if (WaitForSingleObject(builder_cv, INFINITE) == WAIT_FAILED)
-           ABORT("WaitForSingleObject() failed");
+        GC_acquire_mark_lock();
+        if (GC_fl_builder_count == 0)
+            break;
+        if (ResetEvent(builder_cv) == FALSE)
+            ABORT("ResetEvent() failed");
+        GC_release_mark_lock();
+        if (WaitForSingleObject(builder_cv, INFINITE) == WAIT_FAILED)
+            ABORT("WaitForSingleObject() failed");
     }
     GC_release_mark_lock();
 }
@@ -1785,12 +1785,12 @@ void GC_notify_all_builder(void)
     GC_ASSERT(builder_cv != 0);
     GC_ASSERT(GC_fl_builder_count == 0);
     if (SetEvent(builder_cv) == FALSE)
-       ABORT("SetEvent() failed");
+        ABORT("SetEvent() failed");
 }
 
 #ifdef DONT_USE_SIGNALANDWAIT
 
-  /* mark_cv is used (for waiting) by a non-helper thread.     */
+  /* mark_cv is used (for waiting) by a non-helper thread.      */
 
 void GC_wait_marker(void)
 {
@@ -1798,17 +1798,17 @@ void GC_wait_marker(void)
     DWORD id = GetCurrentThreadId();
     int i = (int)GC_markers - 1;
     while (i-- > 0) {
-       if (GC_marker_Id[i] == id) {
-           event = GC_marker_cv[i];
-           break;
-       }
+        if (GC_marker_Id[i] == id) {
+            event = GC_marker_cv[i];
+            break;
+        }
     }
 
     if (ResetEvent(event) == FALSE)
-       ABORT("ResetEvent() failed");
+        ABORT("ResetEvent() failed");
     GC_release_mark_lock();
     if (WaitForSingleObject(event, INFINITE) == WAIT_FAILED)
-       ABORT("WaitForSingleObject() failed");
+        ABORT("WaitForSingleObject() failed");
     GC_acquire_mark_lock();
 }
 
@@ -1817,77 +1817,77 @@ void GC_notify_all_marker(void)
     DWORD id = GetCurrentThreadId();
     int i = (int)GC_markers - 1;
     while (i-- > 0) {
-       /* Notify every marker ignoring self (for efficiency).  */
-       if (SetEvent(GC_marker_Id[i] != id ? GC_marker_cv[i] :
-                       mark_cv) == FALSE)
-           ABORT("SetEvent() failed");
+        /* Notify every marker ignoring self (for efficiency).  */
+        if (SetEvent(GC_marker_Id[i] != id ? GC_marker_cv[i] :
+                        mark_cv) == FALSE)
+            ABORT("SetEvent() failed");
     }
 }
 
 #else /* DONT_USE_SIGNALANDWAIT */
 
-/* For GC_wait_marker/GC_notify_all_marker() the above technique does  */
-/* not work because they are used with different checked conditions in */
-/* different places (and, in addition, notifying is done after leaving */
-/* critical section) and this could result in a signal loosing between */
-/* checking for a particular condition and calling WaitForSingleObject.        */
-/* So, we use PulseEvent() and NT SignalObjectAndWait() (which         */
-/* atomically sets mutex event to signaled state and starts waiting on */
-/* condvar). A special case here is GC_mark_mutex_waitcnt == 1 (i.e.   */
-/* nobody waits for mark lock at this moment) - we don't change it     */
-/* (otherwise we may loose a signal sent between decrementing          */
-/* GC_mark_mutex_waitcnt and calling WaitForSingleObject()).           */
+/* For GC_wait_marker/GC_notify_all_marker() the above technique does   */
+/* not work because they are used with different checked conditions in  */
+/* different places (and, in addition, notifying is done after leaving  */
+/* critical section) and this could result in a signal loosing between  */
+/* checking for a particular condition and calling WaitForSingleObject. */
+/* So, we use PulseEvent() and NT SignalObjectAndWait() (which          */
+/* atomically sets mutex event to signaled state and starts waiting on  */
+/* condvar). A special case here is GC_mark_mutex_waitcnt == 1 (i.e.    */
+/* nobody waits for mark lock at this moment) - we don't change it      */
+/* (otherwise we may loose a signal sent between decrementing           */
+/* GC_mark_mutex_waitcnt and calling WaitForSingleObject()).            */
 
 #ifdef MSWINCE
-  /* SignalObjectAndWait() is missing in WinCE (for now), so you should        */
-  /* supply its emulation (externally) to use this code.               */
+  /* SignalObjectAndWait() is missing in WinCE (for now), so you should */
+  /* supply its emulation (externally) to use this code.                */
   WINBASEAPI DWORD WINAPI SignalObjectAndWait(HANDLE, HANDLE, DWORD, BOOL);
 # define signalObjectAndWait_func SignalObjectAndWait
 #else
   typedef DWORD (WINAPI * SignalObjectAndWait_type)(
-               HANDLE, HANDLE, DWORD, BOOL);
+                HANDLE, HANDLE, DWORD, BOOL);
   static SignalObjectAndWait_type signalObjectAndWait_func = 0;
 #endif
 
 void GC_wait_marker(void)
 {
-    /* Here we assume that GC_wait_marker() is always called   */
-    /* from a while(check_cond) loop.                          */
+    /* Here we assume that GC_wait_marker() is always called    */
+    /* from a while(check_cond) loop.                           */
     AO_t waitcnt;
     GC_ASSERT(mark_cv != 0);
 
-    /* We inline GC_release_mark_lock() to have atomic         */
-    /* unlock-and-wait action here.                            */
+    /* We inline GC_release_mark_lock() to have atomic          */
+    /* unlock-and-wait action here.                             */
     GC_ASSERT(GC_mark_lock_holder == (unsigned long)GetCurrentThreadId());
 #   ifdef GC_ASSERTIONS
-       GC_mark_lock_holder = NO_THREAD;
+        GC_mark_lock_holder = NO_THREAD;
 #   endif
-    
+
     if ((waitcnt = AO_load(&GC_mark_mutex_waitcnt)) > 1) {
-       (void)AO_fetch_and_sub1_release(&GC_mark_mutex_waitcnt);
+        (void)AO_fetch_and_sub1_release(&GC_mark_mutex_waitcnt);
     } else {
-       GC_ASSERT(AO_load(&GC_mark_mutex_waitcnt) != 0);
+        GC_ASSERT(AO_load(&GC_mark_mutex_waitcnt) != 0);
     }
 
     /* The state of mark_cv is non-signaled here. */
     if (signalObjectAndWait_func(mark_mutex_event /* hObjectToSignal */,
-                               mark_cv /* hObjectToWaitOn */,
-                               INFINITE /* timeout */,
-                               FALSE /* isAlertable */) == WAIT_FAILED)
-       ABORT("SignalObjectAndWait() failed");
+                                mark_cv /* hObjectToWaitOn */,
+                                INFINITE /* timeout */,
+                                FALSE /* isAlertable */) == WAIT_FAILED)
+        ABORT("SignalObjectAndWait() failed");
     /* The state of mark_cv is non-signaled here again. */
 
     if (waitcnt > 1) {
-       GC_acquire_mark_lock();
+        GC_acquire_mark_lock();
     } else {
-       GC_ASSERT(GC_mark_mutex_waitcnt != 0);
-       /* Acquire mark lock */
-       if (WaitForSingleObject(mark_mutex_event, INFINITE) == WAIT_FAILED)
-           ABORT("WaitForSingleObject() failed");
-       GC_ASSERT(GC_mark_lock_holder == NO_THREAD);
-#      ifdef GC_ASSERTIONS
-           GC_mark_lock_holder = (unsigned long)GetCurrentThreadId();
-#      endif
+        GC_ASSERT(GC_mark_mutex_waitcnt != 0);
+        /* Acquire mark lock */
+        if (WaitForSingleObject(mark_mutex_event, INFINITE) == WAIT_FAILED)
+            ABORT("WaitForSingleObject() failed");
+        GC_ASSERT(GC_mark_lock_holder == NO_THREAD);
+#       ifdef GC_ASSERTIONS
+            GC_mark_lock_holder = (unsigned long)GetCurrentThreadId();
+#       endif
     }
 }
 
@@ -1895,7 +1895,7 @@ void GC_notify_all_marker(void)
 {
     GC_ASSERT(mark_cv != 0);
     if (PulseEvent(mark_cv) == FALSE)
-       ABORT("PulseEvent() failed");
+        ABORT("PulseEvent() failed");
 }
 
 #endif /* !DONT_USE_SIGNALANDWAIT */
@@ -1909,8 +1909,8 @@ extern GC_bool GC_wnt;
 
 #ifndef GC_PTHREADS
 
-/* We have no DllMain to take care of new threads.  Thus we    */
-/* must properly intercept thread creation.                    */
+/* We have no DllMain to take care of new threads.  Thus we     */
+/* must properly intercept thread creation.                     */
 
 typedef struct {
     LPTHREAD_START_ROUTINE start;
@@ -1918,7 +1918,7 @@ typedef struct {
 } thread_args;
 
 STATIC void * GC_CALLBACK GC_win32_start_inner(struct GC_stack_base *sb,
-                                               void *arg)
+                                                void *arg)
 {
     void * ret;
     thread_args *args = (thread_args *)arg;
@@ -1929,25 +1929,25 @@ STATIC void * GC_CALLBACK GC_win32_start_inner(struct GC_stack_base *sb,
       GC_printf("thread 0x%x starting...\n", (unsigned)GetCurrentThreadId());
 #   endif
 
-    /* Clear the thread entry even if we exit with an exception.       */
-    /* This is probably pointless, since an uncaught exception is      */
-    /* supposed to result in the process being killed.                 */
+    /* Clear the thread entry even if we exit with an exception.        */
+    /* This is probably pointless, since an uncaught exception is       */
+    /* supposed to result in the process being killed.                  */
 #ifndef __GNUC__
     __try {
 #endif /* __GNUC__ */
-       ret = (void *)(word)args->start (args->param);
+        ret = (void *)(word)args->start (args->param);
 #ifndef __GNUC__
     } __finally {
 #endif /* __GNUC__ */
-       GC_unregister_my_thread();
-       GC_free(args);
+        GC_unregister_my_thread();
+        GC_free(args);
 #ifndef __GNUC__
     }
 #endif /* __GNUC__ */
 
 #   if DEBUG_WIN32_THREADS
       GC_printf("thread 0x%x returned from start routine.\n",
-               (unsigned)GetCurrentThreadId());
+                (unsigned)GetCurrentThreadId());
 #   endif
     return ret;
 }
@@ -1958,8 +1958,8 @@ STATIC DWORD WINAPI GC_win32_start(LPVOID arg)
 }
 
 GC_API HANDLE WINAPI GC_CreateThread(
-    LPSECURITY_ATTRIBUTES lpThreadAttributes, 
-    DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, 
+    LPSECURITY_ATTRIBUTES lpThreadAttributes,
+    DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress,
     LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId )
 {
     HANDLE thread_h;
@@ -1967,33 +1967,33 @@ GC_API HANDLE WINAPI GC_CreateThread(
     thread_args *args;
 
     if (!parallel_initialized) GC_init_parallel();
-               /* make sure GC is initialized (i.e. main thread is attached,
-                  tls initialized) */
+                /* make sure GC is initialized (i.e. main thread is attached,
+                   tls initialized) */
 
 #   if DEBUG_WIN32_THREADS
       GC_printf("About to create a thread from 0x%x\n",
-               (unsigned)GetCurrentThreadId());
+                (unsigned)GetCurrentThreadId());
 #   endif
     if (GC_win32_dll_threads) {
       return CreateThread(lpThreadAttributes, dwStackSize, lpStartAddress,
                         lpParameter, dwCreationFlags, lpThreadId);
     } else {
-      args = GC_malloc_uncollectable(sizeof(thread_args)); 
-       /* Handed off to and deallocated by child thread.       */
+      args = GC_malloc_uncollectable(sizeof(thread_args));
+        /* Handed off to and deallocated by child thread.       */
       if (0 == args) {
-       SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
         return NULL;
       }
 
       /* set up thread arguments */
-       args -> start = lpStartAddress;
-       args -> param = lpParameter;
+        args -> start = lpStartAddress;
+        args -> param = lpParameter;
 
       GC_need_to_lock = TRUE;
       thread_h = CreateThread(lpThreadAttributes,
-                             dwStackSize, GC_win32_start,
-                             args, dwCreationFlags,
-                             lpThreadId);
+                              dwStackSize, GC_win32_start,
+                              args, dwCreationFlags,
+                              lpThreadId);
       if( thread_h == 0 ) GC_free( args );
       return thread_h;
     }
@@ -2017,31 +2017,31 @@ GC_API GC_uintptr_t GC_CALL GC_beginthreadex(
     thread_args *args;
 
     if (!parallel_initialized) GC_init_parallel();
-               /* make sure GC is initialized (i.e. main thread is attached,
-                  tls initialized) */
+                /* make sure GC is initialized (i.e. main thread is attached,
+                   tls initialized) */
 #   if DEBUG_WIN32_THREADS
       GC_printf("About to create a thread from 0x%x\n",
-               (unsigned)GetCurrentThreadId());
+                (unsigned)GetCurrentThreadId());
 #   endif
 
     if (GC_win32_dll_threads) {
       return _beginthreadex(security, stack_size, start_address,
                             arglist, initflag, thrdaddr);
     } else {
-      args = GC_malloc_uncollectable(sizeof(thread_args)); 
-       /* Handed off to and deallocated by child thread.       */
+      args = GC_malloc_uncollectable(sizeof(thread_args));
+        /* Handed off to and deallocated by child thread.       */
       if (0 == args) {
-       SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
         return (GC_uintptr_t)(-1L);
       }
 
       /* set up thread arguments */
-       args -> start = (LPTHREAD_START_ROUTINE)start_address;
-       args -> param = arglist;
+        args -> start = (LPTHREAD_START_ROUTINE)start_address;
+        args -> param = arglist;
 
       GC_need_to_lock = TRUE;
       thread_h = _beginthreadex(security, stack_size,
-                (unsigned (__stdcall *) (void *))GC_win32_start,
+                 (unsigned (__stdcall *) (void *))GC_win32_start,
                                 args, initflag, thrdaddr);
       if( thread_h == 0 ) GC_free( args );
       return thread_h;
@@ -2071,7 +2071,7 @@ static DWORD WINAPI main_thread_start(LPVOID arg)
 {
     main_thread_args * args = (main_thread_args *) arg;
     return (DWORD) GC_WinMain (args->hInstance, args->hPrevInstance,
-                              args->lpCmdLine, args->nShowCmd);
+                               args->lpCmdLine, args->nShowCmd);
 }
 
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
@@ -2080,7 +2080,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
     DWORD exit_code = 1;
 
     main_thread_args args = {
-       hInstance, hPrevInstance, lpCmdLine, nShowCmd
+        hInstance, hPrevInstance, lpCmdLine, nShowCmd
     };
     HANDLE thread_h;
     DWORD thread_id;
@@ -2091,16 +2091,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
     /* start the main thread */
     thread_h = GC_CreateThread(NULL /* lpsa */, 0 /* dwStackSize (ignored) */,
                        main_thread_start, &args, 0 /* fdwCreate */,
-                       &thread_id);
+                        &thread_id);
 
     if (thread_h != NULL)
     {
-       if (WaitForSingleObject (thread_h, INFINITE) == WAIT_FAILED)
-           ABORT("WaitForSingleObject(main_thread) failed");
-       GetExitCodeThread (thread_h, &exit_code);
-       CloseHandle (thread_h);
+        if (WaitForSingleObject (thread_h, INFINITE) == WAIT_FAILED)
+            ABORT("WaitForSingleObject(main_thread) failed");
+        GetExitCodeThread (thread_h, &exit_code);
+        CloseHandle (thread_h);
     } else {
-       ABORT("GC_CreateThread(main_thread) failed");
+        ABORT("GC_CreateThread(main_thread) failed");
     }
 
     GC_deinit();
@@ -2111,7 +2111,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
 
 #endif /* MSWINCE */
 
-/* Called by GC_init() - we hold the allocation lock.  */
+/* Called by GC_init() - we hold the allocation lock.   */
 void GC_thr_init(void) {
     struct GC_stack_base sb;
 #   ifdef GC_ASSERTIONS
@@ -2123,97 +2123,97 @@ void GC_thr_init(void) {
     GC_main_thread = GetCurrentThreadId();
     GC_thr_initialized = TRUE;
 
-    /* Add the initial thread, so we can stop it.      */
+    /* Add the initial thread, so we can stop it.       */
 #   ifdef GC_ASSERTIONS
       sb_result =
 #   endif
-       GC_get_stack_base(&sb);
+        GC_get_stack_base(&sb);
     GC_ASSERT(sb_result == GC_SUCCESS);
-    
+
 #   if defined(PARALLEL_MARK)
       /* Set GC_markers. */
       {
-       char * markers_string = GETENV("GC_MARKERS");
-       if (markers_string != NULL) {
-         GC_markers = atoi(markers_string);
-         if (GC_markers > MAX_MARKERS) {
-           WARN("Limiting number of mark threads\n", 0);
-           GC_markers = MAX_MARKERS;
-         }
-       } else {
-#      ifdef MSWINCE
-         /* There is no GetProcessAffinityMask() in WinCE.     */
-         /* GC_sysinfo is already initialized.                 */
-         GC_markers = GC_sysinfo.dwNumberOfProcessors;
-#      else
-#        ifdef _WIN64
-           DWORD_PTR procMask = 0;
-           DWORD_PTR sysMask;
-#        else
-           DWORD procMask = 0;
-           DWORD sysMask;
-#        endif
-         int ncpu = 0;
-         if (GetProcessAffinityMask(GetCurrentProcess(),
-                               (void *)&procMask, (void *)&sysMask)
-             && procMask) {
-           do {
-             ncpu++;
-           } while ((procMask &= procMask - 1) != 0);
-         }
-         GC_markers = ncpu;
-#      endif
-#        ifdef GC_MIN_MARKERS
-           /* This is primarily for testing on systems without getenv(). */
-           if (GC_markers < GC_MIN_MARKERS)
-             GC_markers = GC_MIN_MARKERS;
-#        endif
-         if (GC_markers >= MAX_MARKERS)
-           GC_markers = MAX_MARKERS; /* silently limit GC_markers value */
-       }
-      }        
-      
+        char * markers_string = GETENV("GC_MARKERS");
+        if (markers_string != NULL) {
+          GC_markers = atoi(markers_string);
+          if (GC_markers > MAX_MARKERS) {
+            WARN("Limiting number of mark threads\n", 0);
+            GC_markers = MAX_MARKERS;
+          }
+        } else {
+#       ifdef MSWINCE
+          /* There is no GetProcessAffinityMask() in WinCE.     */
+          /* GC_sysinfo is already initialized.                 */
+          GC_markers = GC_sysinfo.dwNumberOfProcessors;
+#       else
+#         ifdef _WIN64
+            DWORD_PTR procMask = 0;
+            DWORD_PTR sysMask;
+#         else
+            DWORD procMask = 0;
+            DWORD sysMask;
+#         endif
+          int ncpu = 0;
+          if (GetProcessAffinityMask(GetCurrentProcess(),
+                                (void *)&procMask, (void *)&sysMask)
+              && procMask) {
+            do {
+              ncpu++;
+            } while ((procMask &= procMask - 1) != 0);
+          }
+          GC_markers = ncpu;
+#       endif
+#         ifdef GC_MIN_MARKERS
+            /* This is primarily for testing on systems without getenv(). */
+            if (GC_markers < GC_MIN_MARKERS)
+              GC_markers = GC_MIN_MARKERS;
+#         endif
+          if (GC_markers >= MAX_MARKERS)
+            GC_markers = MAX_MARKERS; /* silently limit GC_markers value */
+        }
+      }
+
       /* Set GC_parallel. */
       {
-#      if !defined(GC_PTHREADS_PARAMARK) && !defined(MSWINCE) \
-               && !defined(DONT_USE_SIGNALANDWAIT)
-         HMODULE hK32;
-         /* SignalObjectAndWait() API call works only under NT.        */
-#      endif
-       if (GC_markers <= 1 || GC_win32_dll_threads
-#          if !defined(GC_PTHREADS_PARAMARK) && !defined(MSWINCE) \
-               && !defined(DONT_USE_SIGNALANDWAIT)
-             || GC_wnt == FALSE
-             || (hK32 = GetModuleHandle(TEXT("kernel32.dll"))) == (HMODULE)0
-             || (signalObjectAndWait_func = (SignalObjectAndWait_type)
-                       GetProcAddress(hK32, "SignalObjectAndWait")) == 0
-#          endif
-          ) {
-         /* Disable parallel marking. */
-         GC_parallel = FALSE;
-         GC_markers = 1;
-       } else {
-#        ifndef GC_PTHREADS_PARAMARK
-           /* Initialize Win32 event objects for parallel marking.     */
-           mark_mutex_event = CreateEvent(NULL /* attrs */,
-                               FALSE /* isManualReset */,
-                               FALSE /* initialState */, NULL /* name */);
-           builder_cv = CreateEvent(NULL /* attrs */,
-                               TRUE /* isManualReset */,
-                               FALSE /* initialState */, NULL /* name */);
-           mark_cv = CreateEvent(NULL /* attrs */, TRUE /* isManualReset */,
-                               FALSE /* initialState */, NULL /* name */);
-           if (mark_mutex_event == (HANDLE)0 || builder_cv == (HANDLE)0
-               || mark_cv == (HANDLE)0)
-             ABORT("CreateEvent() failed");
-#        endif
-         GC_parallel = TRUE;
-         /* Disable true incremental collection, but generational is OK. */
-         GC_time_limit = GC_TIME_UNLIMITED;
-       }
+#       if !defined(GC_PTHREADS_PARAMARK) && !defined(MSWINCE) \
+                && !defined(DONT_USE_SIGNALANDWAIT)
+          HMODULE hK32;
+          /* SignalObjectAndWait() API call works only under NT.        */
+#       endif
+        if (GC_markers <= 1 || GC_win32_dll_threads
+#           if !defined(GC_PTHREADS_PARAMARK) && !defined(MSWINCE) \
+                && !defined(DONT_USE_SIGNALANDWAIT)
+              || GC_wnt == FALSE
+              || (hK32 = GetModuleHandle(TEXT("kernel32.dll"))) == (HMODULE)0
+              || (signalObjectAndWait_func = (SignalObjectAndWait_type)
+                        GetProcAddress(hK32, "SignalObjectAndWait")) == 0
+#           endif
+           ) {
+          /* Disable parallel marking. */
+          GC_parallel = FALSE;
+          GC_markers = 1;
+        } else {
+#         ifndef GC_PTHREADS_PARAMARK
+            /* Initialize Win32 event objects for parallel marking.     */
+            mark_mutex_event = CreateEvent(NULL /* attrs */,
+                                FALSE /* isManualReset */,
+                                FALSE /* initialState */, NULL /* name */);
+            builder_cv = CreateEvent(NULL /* attrs */,
+                                TRUE /* isManualReset */,
+                                FALSE /* initialState */, NULL /* name */);
+            mark_cv = CreateEvent(NULL /* attrs */, TRUE /* isManualReset */,
+                                FALSE /* initialState */, NULL /* name */);
+            if (mark_mutex_event == (HANDLE)0 || builder_cv == (HANDLE)0
+                || mark_cv == (HANDLE)0)
+              ABORT("CreateEvent() failed");
+#         endif
+          GC_parallel = TRUE;
+          /* Disable true incremental collection, but generational is OK. */
+          GC_time_limit = GC_TIME_UNLIMITED;
+        }
       }
 #   endif /* PARALLEL_MARK */
-    
+
     GC_ASSERT(0 == GC_lookup_thread_inner(GC_main_thread));
     GC_register_my_thread_inner(&sb, GC_main_thread);
 
@@ -2240,20 +2240,20 @@ GC_API int GC_pthread_join(pthread_t pthread_id, void **retval) {
 
 #   if DEBUG_CYGWIN_THREADS
       GC_printf("thread 0x%x(0x%x) is joining thread 0x%x.\n",
-               (int)pthread_self(), (int)GetCurrentThreadId(),
-               (int)pthread_id);
+                (int)pthread_self(), (int)GetCurrentThreadId(),
+                (int)pthread_id);
 #   endif
 #   if DEBUG_WIN32_PTHREADS
       GC_printf("thread 0x%x(0x%x) is joining thread 0x%x.\n",
-               (int)(pthread_self()).p, (int)GetCurrentThreadId(),
-               pthread_id.p);
+                (int)(pthread_self()).p, (int)GetCurrentThreadId(),
+                pthread_id.p);
 #   endif
 
     if (!parallel_initialized) GC_init_parallel();
     /* Thread being joined might not have registered itself yet. */
-    /* After the join,thread id may have been recycled.                 */
-    /* FIXME: It would be better if this worked more like       */
-    /* pthread_support.c.                                       */
+    /* After the join,thread id may have been recycled.          */
+    /* FIXME: It would be better if this worked more like        */
+    /* pthread_support.c.                                        */
 
 #   ifndef GC_WIN32_PTHREADS
       while ((joinee = GC_lookup_pthread(pthread_id)) == 0) Sleep(10);
@@ -2270,17 +2270,17 @@ GC_API int GC_pthread_join(pthread_t pthread_id, void **retval) {
       LOCK();
       GC_delete_gc_thread(joinee);
       UNLOCK();
-    } /* otherwise dllmain handles it. */
+    } /* otherwise dllmain handles it.  */
 
 #   if DEBUG_CYGWIN_THREADS
       GC_printf("thread 0x%x(0x%x) completed join with thread 0x%x.\n",
-               (int)pthread_self(), (int)GetCurrentThreadId(),
-               (int)pthread_id);
+                (int)pthread_self(), (int)GetCurrentThreadId(),
+                (int)pthread_id);
 #   endif
 #   if DEBUG_WIN32_PTHREADS
       GC_printf("thread 0x%x(0x%x) completed join with thread 0x%x.\n",
-               (int)(pthread_self()).p, (int)GetCurrentThreadId(),
-               pthread_id.p);
+                (int)(pthread_self()).p, (int)GetCurrentThreadId(),
+                pthread_id.p);
 #   endif
 
     return result;
@@ -2291,50 +2291,50 @@ GC_API int GC_pthread_join(pthread_t pthread_id, void **retval) {
  *   so intercept pthread_create instead
  */
 GC_API int GC_pthread_create(pthread_t *new_thread,
-                 const pthread_attr_t *attr,
+                  const pthread_attr_t *attr,
                   void *(*start_routine)(void *), void *arg) {
     int result;
     struct start_info * si;
 
     if (!parallel_initialized) GC_init_parallel();
-               /* make sure GC is initialized (i.e. main thread is attached) */
+                /* make sure GC is initialized (i.e. main thread is attached) */
     if (GC_win32_dll_threads) {
       return pthread_create(new_thread, attr, start_routine, arg);
     }
-    
+
     /* This is otherwise saved only in an area mmapped by the thread */
-    /* library, which isn't visible to the collector.           */
-    si = GC_malloc_uncollectable(sizeof(struct start_info)); 
+    /* library, which isn't visible to the collector.            */
+    si = GC_malloc_uncollectable(sizeof(struct start_info));
     if (0 == si) return(EAGAIN);
 
     si -> start_routine = start_routine;
     si -> arg = arg;
     if (attr != 0 &&
         pthread_attr_getdetachstate(attr, &si->detached)
-       == PTHREAD_CREATE_DETACHED) {
+        == PTHREAD_CREATE_DETACHED) {
       si->detached = TRUE;
     }
 
 #   if DEBUG_CYGWIN_THREADS
       GC_printf("About to create a thread from 0x%x(0x%x)\n",
-               (int)pthread_self(), (int)GetCurrentThreadId);
+                (int)pthread_self(), (int)GetCurrentThreadId);
 #   endif
 #   if DEBUG_WIN32_PTHREADS
       GC_printf("About to create a thread from 0x%x(0x%x)\n",
-               (int)(pthread_self()).p, (int)GetCurrentThreadId());
+                (int)(pthread_self()).p, (int)GetCurrentThreadId());
 #   endif
     GC_need_to_lock = TRUE;
-    result = pthread_create(new_thread, attr, GC_pthread_start, si); 
+    result = pthread_create(new_thread, attr, GC_pthread_start, si);
 
     if (result) { /* failure */
-       GC_free(si);
-    } 
+        GC_free(si);
+    }
 
     return(result);
 }
 
 STATIC void * GC_CALLBACK GC_pthread_start_inner(struct GC_stack_base *sb,
-                                               void * arg)
+                                                void * arg)
 {
     struct start_info * si = arg;
     void * result;
@@ -2346,20 +2346,20 @@ STATIC void * GC_CALLBACK GC_pthread_start_inner(struct GC_stack_base *sb,
 
 #   if DEBUG_CYGWIN_THREADS
       GC_printf("thread 0x%x(0x%x) starting...\n",(int)pthread_id,
-                                                 (int)thread_id);
+                                                  (int)thread_id);
 #   endif
 #   if DEBUG_WIN32_PTHREADS
       GC_printf("thread 0x%x(0x%x) starting...\n",(int) pthread_id.p,
-                                                 (int)thread_id);
+                                                  (int)thread_id);
 #   endif
 
     GC_ASSERT(!GC_win32_dll_threads);
-    /* If a GC occurs before the thread is registered, that GC will    */
+    /* If a GC occurs before the thread is registered, that GC will     */
     /* ignore this thread.  That's fine, since it will block trying to  */
-    /* acquire the allocation lock, and won't yet hold interesting     */
-    /* pointers.                                                       */
+    /* acquire the allocation lock, and won't yet hold interesting      */
+    /* pointers.                                                        */
     LOCK();
-    /* We register the thread here instead of in the parent, so that   */
+    /* We register the thread here instead of in the parent, so that    */
     /* we don't need to hold the allocation lock during pthread_create. */
     me = GC_register_my_thread_inner(sb, thread_id);
     SET_PTHREAD_MAP_CACHE(pthread_id, thread_id);
@@ -2379,11 +2379,11 @@ STATIC void * GC_CALLBACK GC_pthread_start_inner(struct GC_stack_base *sb,
 
 #   if DEBUG_CYGWIN_THREADS
       GC_printf("thread 0x%x(0x%x) returned from start routine.\n",
-               (int)pthread_self(),(int)GetCurrentThreadId());
+                (int)pthread_self(),(int)GetCurrentThreadId());
 #   endif
 #   if DEBUG_WIN32_PTHREADS
       GC_printf("thread 0x%x(0x%x) returned from start routine.\n",
-               (int)(pthread_self()).p, (int)GetCurrentThreadId());
+                (int)(pthread_self()).p, (int)GetCurrentThreadId());
 #   endif
 
     return(result);
@@ -2401,11 +2401,11 @@ STATIC void GC_thread_exit_proc(void *arg)
     GC_ASSERT(!GC_win32_dll_threads);
 #   if DEBUG_CYGWIN_THREADS
       GC_printf("thread 0x%x(0x%x) called pthread_exit().\n",
-               (int)pthread_self(),(int)GetCurrentThreadId());
+                (int)pthread_self(),(int)GetCurrentThreadId());
 #   endif
 #   if DEBUG_WIN32_PTHREADS
       GC_printf("thread 0x%x(0x%x) called pthread_exit().\n",
-               (int)(pthread_self()).p,(int)GetCurrentThreadId());
+                (int)(pthread_self()).p,(int)GetCurrentThreadId());
 #   endif
 
     LOCK();
@@ -2434,7 +2434,7 @@ GC_API int GC_pthread_detach(pthread_t thread)
 {
     int result;
     GC_thread thread_gc_id;
-    
+
     if (!parallel_initialized) GC_init_parallel();
     LOCK();
     thread_gc_id = GC_lookup_pthread(thread);
@@ -2480,8 +2480,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
 #   ifdef PARALLEL_MARK
       /* Don't register marker threads. */
       if (GC_parallel) {
-         /* We could reach here only if parallel_initialized == FALSE. */
-         break;
+          /* We could reach here only if parallel_initialized == FALSE. */
+          break;
       }
 #   endif
     GC_ASSERT(entry_count == 0 || parallel_initialized);
@@ -2490,21 +2490,21 @@ BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
     /* This may run with the collector uninitialized. */
     thread_id = GetCurrentThreadId();
     if (parallel_initialized && GC_main_thread != thread_id) {
-       /* Don't lock here.     */
-#      ifdef GC_ASSERTIONS
+        /* Don't lock here.     */
+#       ifdef GC_ASSERTIONS
           sb_result =
 #       endif
-           GC_get_stack_base(&sb);
+            GC_get_stack_base(&sb);
         GC_ASSERT(sb_result == GC_SUCCESS);
 #       if defined(THREAD_LOCAL_ALLOC) || defined(PARALLEL_MARK)
-         ABORT("Cannot initialize thread local cache from DllMain");
+          ABORT("Cannot initialize thread local cache from DllMain");
 #       endif
-       GC_register_my_thread_inner(&sb, thread_id);
+        GC_register_my_thread_inner(&sb, thread_id);
     } /* o.w. we already did it during GC_thr_init(), called by GC_init() */
     break;
 
    case DLL_THREAD_DETACH:
-    /* We are hopefully running in the context of the exiting thread.  */
+    /* We are hopefully running in the context of the exiting thread.   */
     GC_ASSERT(parallel_initialized);
     if (!GC_win32_dll_threads) return TRUE;
     GC_delete_thread(GetCurrentThreadId());
@@ -2520,7 +2520,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
       for (i = 0; i <= my_max; ++i)
       {
           if (AO_load(&(dll_thread_table[i].in_use)))
-           GC_delete_gc_thread(dll_thread_table + i);
+            GC_delete_gc_thread(dll_thread_table + i);
       }
 
       GC_deinit();
@@ -2535,25 +2535,25 @@ BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
 
 #endif /* !GC_PTHREADS */
 
-/* Perform all initializations, including those that   */
-/* may require allocation.                             */
-/* Called without allocation lock.                     */
-/* Must be called before a second thread is created.   */
+/* Perform all initializations, including those that    */
+/* may require allocation.                              */
+/* Called without allocation lock.                      */
+/* Must be called before a second thread is created.    */
 void GC_init_parallel(void)
 {
     if (parallel_initialized) return;
     parallel_initialized = TRUE;
-    /* GC_init() calls us back, so set flag first.     */
-    
+    /* GC_init() calls us back, so set flag first.      */
+
     if (!GC_is_initialized) GC_init();
     if (GC_win32_dll_threads) {
       GC_need_to_lock = TRUE;
-       /* Cannot intercept thread creation.  Hence we don't know if    */
-       /* other threads exist.  However, client is not allowed to      */
-       /* create other threads before collector initialization.        */
-       /* Thus it's OK not to lock before this.                        */
+        /* Cannot intercept thread creation.  Hence we don't know if    */
+        /* other threads exist.  However, client is not allowed to      */
+        /* create other threads before collector initialization.        */
+        /* Thus it's OK not to lock before this.                        */
     }
-    /* Initialize thread local free lists if used.     */
+    /* Initialize thread local free lists if used.      */
 #   if defined(THREAD_LOCAL_ALLOC)
       LOCK();
       GC_init_thread_local(&GC_lookup_thread_inner(GetCurrentThreadId())->tlfs);
@@ -2562,12 +2562,12 @@ void GC_init_parallel(void)
 }
 
 #if defined(USE_PTHREAD_LOCKS)
-  /* Support for pthread locking code.         */
-  /* Pthread_mutex_try_lock may not win here,  */
-  /* due to builtin support for spinning first?        */
+  /* Support for pthread locking code.          */
+  /* Pthread_mutex_try_lock may not win here,   */
+  /* due to builtin support for spinning first? */
 
 volatile GC_bool GC_collecting = 0;
-                       /* A hint that we're in the collector and       */
+                        /* A hint that we're in the collector and       */
                         /* holding the allocation lock for an           */
                         /* extended period.                             */
 
@@ -2581,21 +2581,21 @@ void GC_lock(void)
 
 /* Add thread-local allocation support.  Microsoft uses __declspec(thread) */
 
-/* We must explicitly mark ptrfree and gcj free lists, since the free  */
-/* list links wouldn't otherwise be found.  We also set them in the    */
-/* normal free lists, since that involves touching less memory than if */
-/* we scanned them normally.                                           */
+/* We must explicitly mark ptrfree and gcj free lists, since the free   */
+/* list links wouldn't otherwise be found.  We also set them in the     */
+/* normal free lists, since that involves touching less memory than if  */
+/* we scanned them normally.                                            */
 void GC_mark_thread_local_free_lists(void)
 {
     int i;
     GC_thread p;
-    
+
     for (i = 0; i < THREAD_TABLE_SZ; ++i) {
       for (p = GC_threads[i]; 0 != p; p = p -> next) {
 #       ifdef DEBUG_THREADS
-         GC_printf("Marking thread locals for 0x%x\n", p -> id);
-#      endif
-       GC_mark_thread_local_fls_for(&(p->tlfs));
+          GC_printf("Marking thread locals for 0x%x\n", p -> id);
+#       endif
+        GC_mark_thread_local_fls_for(&(p->tlfs));
       }
     }
 }
@@ -2604,22 +2604,22 @@ void GC_mark_thread_local_free_lists(void)
     void GC_check_tls_for(GC_tlfs p);
 #   if defined(USE_CUSTOM_SPECIFIC)
       void GC_check_tsd_marks(tsd *key);
-#   endif 
-    /* Check that all thread-local free-lists are completely marked.   */
-    /* also check that thread-specific-data structures are marked.     */
+#   endif
+    /* Check that all thread-local free-lists are completely marked.    */
+    /* also check that thread-specific-data structures are marked.      */
     void GC_check_tls(void) {
-       int i;
-       GC_thread p;
-       
-       for (i = 0; i < THREAD_TABLE_SZ; ++i) {
-         for (p = GC_threads[i]; 0 != p; p = p -> next) {
-           GC_check_tls_for(&(p->tlfs));
-         }
-       }
+        int i;
+        GC_thread p;
+
+        for (i = 0; i < THREAD_TABLE_SZ; ++i) {
+          for (p = GC_threads[i]; 0 != p; p = p -> next) {
+            GC_check_tls_for(&(p->tlfs));
+          }
+        }
 #       if defined(USE_CUSTOM_SPECIFIC)
-         if (GC_thread_key != 0)
-           GC_check_tsd_marks(GC_thread_key);
-#      endif 
+          if (GC_thread_key != 0)
+            GC_check_tsd_marks(GC_thread_key);
+#       endif
     }
 #endif /* GC_ASSERTIONS */