core: Remove code duplication.
* src/gc.c (copy_news): Remove copy of copy_cell. (gc_copy): Use copy_cell instead.
This commit is contained in:
parent
c7777121e8
commit
7b993b35b9
12
src/gc.c
12
src/gc.c
|
@ -212,14 +212,6 @@ copy_cell (struct scm *to, struct scm *from)
|
||||||
to->cdr = from->cdr;
|
to->cdr = from->cdr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
copy_news (struct scm *to, struct scm *from)
|
|
||||||
{
|
|
||||||
to->type = from->type;
|
|
||||||
to->car = from->car;
|
|
||||||
to->cdr = from->cdr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
copy_stack (long index, struct scm *from)
|
copy_stack (long index, struct scm *from)
|
||||||
{
|
{
|
||||||
|
@ -483,14 +475,14 @@ gc_copy (struct scm *old) /*:((internal)) */
|
||||||
return old->car;
|
return old->car;
|
||||||
struct scm *new = g_free;
|
struct scm *new = g_free;
|
||||||
g_free = g_free + M2_CELL_SIZE;
|
g_free = g_free + M2_CELL_SIZE;
|
||||||
copy_news (new, old);
|
copy_cell (new, old);
|
||||||
if (new->type == TSTRUCT || new->type == TVECTOR)
|
if (new->type == TSTRUCT || new->type == TVECTOR)
|
||||||
{
|
{
|
||||||
new->vector = g_free;
|
new->vector = g_free;
|
||||||
long i;
|
long i;
|
||||||
for (i = 0; i < old->length; i = i + 1)
|
for (i = 0; i < old->length; i = i + 1)
|
||||||
{
|
{
|
||||||
copy_news (g_free, cell_ref (old->vector, i));
|
copy_cell (g_free, cell_ref (old->vector, i));
|
||||||
g_free = g_free + M2_CELL_SIZE;
|
g_free = g_free + M2_CELL_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue