2004-08-29 03:20:19 -04:00
|
|
|
bool gc_in_progress;
|
2004-12-10 21:39:45 -05:00
|
|
|
int64_t gc_time;
|
2004-07-16 02:26:21 -04:00
|
|
|
|
2004-11-27 22:26:05 -05:00
|
|
|
/* Given a pointer to oldspace, copy it to newspace. */
|
|
|
|
INLINE void* copy_untagged_object(void* pointer, CELL size)
|
|
|
|
{
|
|
|
|
void* newpointer = allot(size);
|
|
|
|
memcpy(newpointer,pointer,size);
|
|
|
|
|
|
|
|
return newpointer;
|
|
|
|
}
|
|
|
|
|
2004-12-11 13:26:36 -05:00
|
|
|
CELL copy_object_impl(CELL pointer);
|
|
|
|
|
|
|
|
INLINE void copy_object(CELL* handle)
|
|
|
|
{
|
|
|
|
CELL pointer = *handle;
|
|
|
|
CELL tag;
|
|
|
|
CELL header;
|
|
|
|
CELL newpointer;
|
|
|
|
|
|
|
|
if(pointer == F)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tag = TAG(pointer);
|
|
|
|
|
|
|
|
if(tag == FIXNUM_TYPE)
|
|
|
|
return;
|
|
|
|
|
|
|
|
header = get(UNTAG(pointer));
|
|
|
|
if(TAG(header) == GC_COLLECTED)
|
|
|
|
newpointer = UNTAG(header);
|
|
|
|
else
|
|
|
|
newpointer = copy_object_impl(pointer);
|
|
|
|
*handle = RETAG(newpointer,tag);
|
|
|
|
}
|
|
|
|
|
2004-07-16 02:26:21 -04:00
|
|
|
void collect_roots(void);
|
|
|
|
void primitive_gc(void);
|
2004-10-12 23:49:43 -04:00
|
|
|
void maybe_garbage_collection(void);
|
2004-11-22 19:15:14 -05:00
|
|
|
void primitive_gc_time(void);
|