mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Fixed compile error
This commit is contained in:
parent
5818ffc0eb
commit
fa26b18b01
1 changed files with 15 additions and 15 deletions
30
runtime.c
30
runtime.c
|
@ -2452,7 +2452,7 @@ void gc_mark_globals()
|
|||
}
|
||||
}
|
||||
|
||||
char *gc_fixup_moved_obj(gc_thread_data *thd, int *alloci, object hp)
|
||||
char *gc_fixup_moved_obj(gc_thread_data *thd, int *alloci, char *obj, object hp)
|
||||
{
|
||||
// hp ==> new heap object, point to it from old stack object
|
||||
forward(obj) = hp;
|
||||
|
@ -2468,65 +2468,65 @@ char *gc_move(char *obj, gc_thread_data *thd, int *alloci, int *heap_grown) {
|
|||
switch(type_of(obj)){
|
||||
case cons_tag: {
|
||||
list hp = gc_alloc(Cyc_heap, sizeof(cons_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case macro_tag: {
|
||||
macro_type *hp = gc_alloc(Cyc_heap, sizeof(macro_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case closure0_tag: {
|
||||
closure0_type *hp = gc_alloc(Cyc_heap, sizeof(closure0_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case closure1_tag: {
|
||||
closure1_type *hp = gc_alloc(Cyc_heap, sizeof(closure1_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case closure2_tag: {
|
||||
closure2_type *hp = gc_alloc(Cyc_heap, sizeof(closure2_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case closure3_tag: {
|
||||
closure3_type *hp = gc_alloc(Cyc_heap, sizeof(closure3_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case closure4_tag: {
|
||||
closure4_type *hp = gc_alloc(Cyc_heap, sizeof(closure4_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case closureN_tag: {
|
||||
closureN_type *hp = gc_alloc(Cyc_heap,
|
||||
sizeof(closureN_type) + sizeof(object) * (((closureN) obj)->num_elt),
|
||||
obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case vector_tag: {
|
||||
vector_type *hp = gc_alloc(Cyc_heap,
|
||||
sizeof(vector_type) + sizeof(object) * (((vector) obj)->num_elt),
|
||||
obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case string_tag: {
|
||||
string_type *hp = gc_alloc(Cyc_heap,
|
||||
sizeof(string_type) + ((string_len(obj) + 1)),
|
||||
obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case integer_tag: {
|
||||
integer_type *hp = gc_alloc(Cyc_heap, sizeof(integer_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case double_tag: {
|
||||
double_type *hp = gc_alloc(Cyc_heap, sizeof(double_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case port_tag: {
|
||||
port_type *hp = gc_alloc(Cyc_heap, sizeof(port_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case cvar_tag: {
|
||||
cvar_type *hp = gc_alloc(Cyc_heap, sizeof(cvar_type), obj, thd, heap_grown);
|
||||
return gc_fixup_moved_obj(thd, alloci, hp);
|
||||
return gc_fixup_moved_obj(thd, alloci, obj, hp);
|
||||
}
|
||||
case forward_tag:
|
||||
return (char *)forward(obj);
|
||||
|
|
Loading…
Add table
Reference in a new issue