mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Refactoring
This commit is contained in:
parent
ef1db96f2a
commit
df20aaa6d3
4 changed files with 6 additions and 6 deletions
4
gc.c
4
gc.c
|
@ -268,7 +268,7 @@ char *gc_copy_obj(object dest, char *obj, gc_thread_data *thd)
|
||||||
type_of(hp) = closure1_tag;
|
type_of(hp) = closure1_tag;
|
||||||
hp->fn = ((closure1) obj)->fn;
|
hp->fn = ((closure1) obj)->fn;
|
||||||
hp->num_args = ((closure1) obj)->num_args;
|
hp->num_args = ((closure1) obj)->num_args;
|
||||||
hp->elt1 = ((closure1) obj)->elt1;
|
hp->element = ((closure1) obj)->element;
|
||||||
return (char *)hp;
|
return (char *)hp;
|
||||||
}
|
}
|
||||||
case closureN_tag: {
|
case closureN_tag: {
|
||||||
|
@ -1035,7 +1035,7 @@ void gc_mark_black(object obj)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case closure1_tag:
|
case closure1_tag:
|
||||||
gc_collector_mark_gray(obj, ((closure1) obj)->elt1);
|
gc_collector_mark_gray(obj, ((closure1) obj)->element);
|
||||||
break;
|
break;
|
||||||
case closureN_tag: {
|
case closureN_tag: {
|
||||||
int i, n = ((closureN) obj)->num_elt;
|
int i, n = ((closureN) obj)->num_elt;
|
||||||
|
|
|
@ -492,7 +492,7 @@ typedef struct {
|
||||||
tag_type tag;
|
tag_type tag;
|
||||||
function_type fn;
|
function_type fn;
|
||||||
int num_args;
|
int num_args;
|
||||||
object elt1;
|
object element;
|
||||||
} closure1_type;
|
} closure1_type;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gc_header_type hdr;
|
gc_header_type hdr;
|
||||||
|
@ -532,7 +532,7 @@ typedef closure0_type *macro;
|
||||||
c.tag = closure1_tag; \
|
c.tag = closure1_tag; \
|
||||||
c.fn = f; \
|
c.fn = f; \
|
||||||
c.num_args = -1; \
|
c.num_args = -1; \
|
||||||
c.elt1 = a;
|
c.element = a;
|
||||||
|
|
||||||
/* Primitive types */
|
/* Primitive types */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -2935,7 +2935,7 @@ int gc_minor(void *data, object low_limit, object high_limit, closure cont, obje
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case closure1_tag:
|
case closure1_tag:
|
||||||
gc_move2heap(((closure1) obj)->elt1);
|
gc_move2heap(((closure1) obj)->element);
|
||||||
break;
|
break;
|
||||||
case closureN_tag: {
|
case closureN_tag: {
|
||||||
int i, n = ((closureN) obj)->num_elt;
|
int i, n = ((closureN) obj)->num_elt;
|
||||||
|
|
|
@ -1607,7 +1607,7 @@
|
||||||
(emit compiled-program)))
|
(emit compiled-program)))
|
||||||
(else
|
(else
|
||||||
;; Do not use closcall1 macro as it might not have been defined
|
;; Do not use closcall1 macro as it might not have been defined
|
||||||
(emit "cont = ((closure1_type *)cont)->elt1;")
|
(emit "cont = ((closure1_type *)cont)->element;")
|
||||||
;(emit "((cont)->fn)(1, cont, cont);")
|
;(emit "((cont)->fn)(1, cont, cont);")
|
||||||
(emit*
|
(emit*
|
||||||
"(((closure)"
|
"(((closure)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue