+2010-02-10 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-gc.c: Round up when calculating the number of scan starts.
+
2010-02-10 Rodrigo Kumpera <rkumpera@novell.com>
* reflection.c: Export mono_get_object_from_blob.
continue;
}
idx = ((char*)addr - (char*)section->data) / SCAN_START_SIZE;
+ g_assert (idx < section->num_scan_start);
search_start = (void*)section->scan_starts [idx];
if (!search_start || search_start > addr) {
while (idx) {
section->data = section->next_data = data;
section->size = alloc_size;
section->end_data = nursery_real_end;
- scan_starts = alloc_size / SCAN_START_SIZE;
+ scan_starts = (alloc_size + SCAN_START_SIZE - 1) / SCAN_START_SIZE;
section->scan_starts = get_internal_mem (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS);
section->num_scan_start = scan_starts;
section->block.role = MEMORY_ROLE_GEN0;
UPDATE_HEAP_BOUNDARIES (section->data, section->end_data);
total_alloc += section->size;
DEBUG (3, fprintf (gc_debug_file, "New major heap section: (%p-%p), total: %zd\n", section->data, section->end_data, total_alloc));
- scan_starts = section->size / SCAN_START_SIZE;
+ scan_starts = (section->size + SCAN_START_SIZE - 1) / SCAN_START_SIZE;
section->scan_starts = get_internal_mem (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS);
section->num_scan_start = scan_starts;
section->block.role = MEMORY_ROLE_GEN1;