Merge branch 'custom-marker'

This commit is contained in:
Yuichi Nishiwaki 2014-09-17 12:57:56 +09:00
commit 06971a1144
2 changed files with 4 additions and 0 deletions

3
gc.c
View File

@ -480,6 +480,9 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
for (it = xh_begin(&data->storage); it != NULL; it = xh_next(it)) {
gc_mark(pic, xh_val(it, pic_value));
}
if (data->type->mark) {
data->type->mark(pic, data->data, gc_mark);
}
break;
}
case PIC_TT_DICT: {

View File

@ -12,6 +12,7 @@ extern "C" {
typedef struct {
const char *type_name;
void (*dtor)(pic_state *, void *);
void (*mark)(pic_state *, void *, void (*)(pic_state *, pic_value));
} pic_data_type;
struct pic_data {