[svn commit] r359 - trunk/gc
jimb at red-bean.com
jimb at red-bean.com
Fri Sep 3 00:47:04 CDT 2004
Author: jimb
Date: Fri Sep 3 00:47:02 2004
New Revision: 359
Modified:
trunk/gc/heap.c
Log:
(scan): Clean up test for doting range a bit.
(scan_block): This block may not necessarily appear at the head of the
list of doting pages if it already doting. The write barrier can add
any page containing live objects to the doting list.
Modified: trunk/gc/heap.c
==============================================================================
--- trunk/gc/heap.c (original)
+++ trunk/gc/heap.c Fri Sep 3 00:47:02 2004
@@ -1724,7 +1724,7 @@
abort ();
}
- if (new_first_doting <= new_last_doting)
+ if (new_first_doting < new_last_doting)
{
char *base = page_base (new_first_doting);
@@ -1771,6 +1771,8 @@
{
struct page *p = find_already_writeable_page (g->scan_addr);
void *base = page_base (g->scan_addr);
+ bool already_doting
+ = p->first_doting_pointer < p->last_doting_pointer;
/* Scan to the end of the page containing g->scan_addr. */
char *end = page_base (g->scan_addr + HEAP_PAGE_SIZE);
@@ -1782,14 +1784,9 @@
g->scan_addr = scan (p, g->scan_addr, end, collect_to);
/* Do we need to add this page to this generation's list of
- doting pages? (And have we not added it already? This could
- happen if we finish scanning this generation, but then
- scanning some older generation allocates more stuff to this
- one. Since we add doting pages to this generation's list
- only as we scan, we would be at the front of the list if we
- were there. */
+ doting pages? */
if (p->first_doting_pointer < p->last_doting_pointer
- && g->doting_pages != base)
+ && ! already_doting)
{
p->next_doting_page
= (uintptr_t) g->doting_pages >> HEAP_LOG_PAGE_SIZE;
@@ -2245,6 +2242,7 @@
return closest;
}
+
/* Initialization. */
More information about the Minor
mailing list