1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

* Minor cleanups in scm_mark_locations.

This commit is contained in:
Dirk Herrmann 2000-07-13 07:40:04 +00:00
parent 0491498616
commit c4da09e2dd
2 changed files with 59 additions and 53 deletions

View file

@ -1,3 +1,8 @@
2000-07-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gc.c (scm_mark_locations): Minimized some variable scopes and
simplified the code a bit.
2000-07-10 Dirk Herrmann <D.Herrmann@tu-bs.de> 2000-07-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gc.h (SCM_SET_FREE_CELL_TYPE, SCM_SET_FREE_CELL_CDR, * gc.h (SCM_SET_FREE_CELL_TYPE, SCM_SET_FREE_CELL_CDR,

View file

@ -1212,60 +1212,61 @@ gc_mark_nimp:
void void
scm_mark_locations (SCM_STACKITEM x[], scm_sizet n) scm_mark_locations (SCM_STACKITEM x[], scm_sizet n)
{ {
register long m = n; unsigned long m;
register int i, j;
register SCM_CELLPTR ptr;
while (0 <= --m) for (m = 0; m < n; ++m)
if (SCM_CELLP (* (SCM *) &x[m])) {
{ SCM obj = * (SCM *) &x[m];
ptr = SCM2PTR (* (SCM *) &x[m]); if (SCM_CELLP (obj))
i = 0; {
j = scm_n_heap_segs - 1; SCM_CELLPTR ptr = SCM2PTR (obj);
if ( SCM_PTR_LE (scm_heap_table[i].bounds[0], ptr) int i = 0;
&& SCM_PTR_GT (scm_heap_table[j].bounds[1], ptr)) int j = scm_n_heap_segs - 1;
{ if (SCM_PTR_LE (scm_heap_table[i].bounds[0], ptr)
while (i <= j) && SCM_PTR_GT (scm_heap_table[j].bounds[1], ptr))
{ {
int seg_id; while (i <= j)
seg_id = -1; {
if ( (i == j) int seg_id;
|| SCM_PTR_GT (scm_heap_table[i].bounds[1], ptr)) seg_id = -1;
seg_id = i; if ((i == j)
else if (SCM_PTR_LE (scm_heap_table[j].bounds[0], ptr)) || SCM_PTR_GT (scm_heap_table[i].bounds[1], ptr))
seg_id = j; seg_id = i;
else else if (SCM_PTR_LE (scm_heap_table[j].bounds[0], ptr))
{ seg_id = j;
int k; else
k = (i + j) / 2; {
if (k == i) int k;
break; k = (i + j) / 2;
if (SCM_PTR_GT (scm_heap_table[k].bounds[1], ptr)) if (k == i)
{ break;
j = k; if (SCM_PTR_GT (scm_heap_table[k].bounds[1], ptr))
++i; {
if (SCM_PTR_LE (scm_heap_table[i].bounds[0], ptr)) j = k;
continue; ++i;
else if (SCM_PTR_LE (scm_heap_table[i].bounds[0], ptr))
break; continue;
} else
else if (SCM_PTR_LE (scm_heap_table[k].bounds[0], ptr)) break;
{ }
i = k; else if (SCM_PTR_LE (scm_heap_table[k].bounds[0], ptr))
--j; {
if (SCM_PTR_GT (scm_heap_table[j].bounds[1], ptr)) i = k;
continue; --j;
else if (SCM_PTR_GT (scm_heap_table[j].bounds[1], ptr))
break; continue;
} else
} break;
if (scm_heap_table[seg_id].span == 1 }
|| SCM_DOUBLE_CELLP (* (SCM *) &x[m])) }
scm_gc_mark (* (SCM *) &x[m]); if (scm_heap_table[seg_id].span == 1
break; || SCM_DOUBLE_CELLP (obj))
} scm_gc_mark (obj);
} break;
} }
}
}
}
} }