Moved static roots to NewGC

svn: r12287
This commit is contained in:
Kevin Tew 2008-11-05 21:08:17 +00:00
parent 5f10e2d80e
commit b6add696af
3 changed files with 7 additions and 4 deletions

View File

@ -2870,6 +2870,7 @@ static long started, rightnow, old;
static void mark_roots()
{
Roots *roots = &GC->roots;
ImmobileBox *ib;
int i;
@ -2912,6 +2913,7 @@ static void mark_roots()
static void fixup_roots()
{
Roots *roots = &GC->roots;
ImmobileBox *ib;
int i;

View File

@ -933,8 +933,9 @@ static inline void *get_stack_base() {
#include "roots.c"
#define traverse_roots(gcMUCK, set_bt_src) { \
#define traverse_roots(gcMUCK, set_bt_src) { \
unsigned long j; \
Roots *roots = &GC->roots; \
if(roots->roots) { \
sort_and_merge_roots(); \
for(j = 0; j < roots->count; j += 2) { \

View File

@ -11,9 +11,6 @@
#define ROOTS_PTR_ALIGNMENT WORD_SIZE
#define ROOTS_PTR_TO_INT(x) ((unsigned long)x)
static Roots *roots = &(Roots) { 0 ,0, 0, 0, };
static void grow_roots(Roots *roots) {
unsigned long *new_roots;
@ -38,6 +35,7 @@ static int compare_roots(const void *a, const void *b)
static void sort_and_merge_roots()
{
Roots *roots = &GC->roots;
if (roots->nothing_new)
return;
@ -83,6 +81,8 @@ static void sort_and_merge_roots()
void GC_add_roots(void *start, void *end)
{
Roots *roots = &GC->roots;
if (roots->count >= roots->size) {
grow_roots(roots);
}