Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 22 Aug 2007 14:54:17 +0000 (14:54 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 22 Aug 2007 14:54:17 +0000 (14:54 -0000)
* sgen-gc.c: ensure section->pin_queue_end is initialized
correctly when non pinning objects in the section have been found.

svn path=/trunk/mono/; revision=84630

mono/metadata/ChangeLog
mono/metadata/sgen-gc.c

index e517fdd30b8d6be108e1a16635f9703bb1033ac3..a68cf3a3a31680959659c8f61cfbdde54d2c30a7 100644 (file)
@@ -1,3 +1,9 @@
+
+Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
+
+       * sgen-gc.c: ensure section->pin_queue_end is initialized
+       correctly when non pinning objects in the section have been found.
+
 2007-08-22  Marek Habersack  <mhabersack@novell.com>
 
        * appdomain.c (set_domain_search_path): cope with PrivateBinPath
index bd85251cf839c0631cf8e7a24ad28c3260a05edb..12fb6f7a400c329a9a3d4b4e4bb365b279692e24 100644 (file)
@@ -1988,7 +1988,11 @@ build_section_fragments (GCMemSection *section)
                frag_end = pin_queue [i];
                /* remove the pin bit from pinned objects */
                unpin_object (frag_end);
-               section->scan_starts [((char*)frag_end - (char*)section->data)/SCAN_START_SIZE] = frag_end;
+               if (frag_end >= section->data + section->size) {
+                       frag_end = section->data + section->size;
+               } else {
+                       section->scan_starts [((char*)frag_end - (char*)section->data)/SCAN_START_SIZE] = frag_end;
+               }
                frag_size = frag_end - frag_start;
                if (frag_size)
                        memset (frag_start, 0, frag_size);
@@ -2144,7 +2148,7 @@ major_collection (void)
        TV_GETTIME (atv);
        DEBUG (6, fprintf (gc_debug_file, "Pinning from sections\n"));
        for (section = section_list; section; section = section->next) {
-               section->pin_queue_start = count = next_pin_slot;
+               section->pin_queue_start = count = section->pin_queue_end = next_pin_slot;
                pin_from_roots (section->data, section->next_data);
                if (count != next_pin_slot) {
                        int reduced_to;