FEP work in progress

db4
Slava Pestov 2008-02-09 02:19:26 -06:00
parent e00db87a0c
commit 7fbbe94d80
1 changed files with 34 additions and 1 deletions

View File

@ -38,6 +38,9 @@ void print_array(F_ARRAY* array, CELL nesting)
CELL length = array_capacity(array); CELL length = array_capacity(array);
CELL i; CELL i;
if(length > 10)
length = 10;
for(i = 0; i < length; i++) for(i = 0; i < length; i++)
{ {
printf(" "); printf(" ");
@ -201,7 +204,7 @@ void dump_objects(F_FIXNUM type)
if(type == -1 || type_of(obj) == type) if(type == -1 || type_of(obj) == type)
{ {
printf("%lx ",obj); printf("%lx ",obj);
print_nested_obj(obj,3); print_nested_obj(obj,1);
printf("\n"); printf("\n");
} }
} }
@ -210,6 +213,36 @@ void dump_objects(F_FIXNUM type)
gc_off = false; gc_off = false;
} }
CELL obj;
CELL look_for;
void find_references_step(CELL *scan)
{
if(look_for == *scan)
{
printf("%lx ",obj);
print_nested_obj(obj,1);
printf("\n");
}
}
void find_references(CELL look_for_)
{
look_for = look_for_;
begin_scan();
CELL obj_;
while((obj_ = next_object()) != F)
{
obj = obj_;
do_slots(obj_,find_references_step);
}
/* end scan */
gc_off = false;
}
void factorbug(void) void factorbug(void)
{ {
reset_stdio(); reset_stdio();