store rectype information to slot hash
This commit is contained in:
@@ -11,7 +11,6 @@ extern "C" {
|
||||
|
||||
struct pic_record {
|
||||
PIC_OBJECT_HEADER
|
||||
pic_value rectype;
|
||||
xhash hash;
|
||||
};
|
||||
|
||||
|
||||
@@ -506,7 +506,6 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||
struct pic_record *rec = (struct pic_record *)obj;
|
||||
xh_iter it;
|
||||
|
||||
gc_mark(pic, rec->rectype);
|
||||
xh_begin(&it, &rec->hash);
|
||||
while (xh_next(&it)) {
|
||||
gc_mark(pic, xh_val(it.e, pic_value));
|
||||
|
||||
+3
-4
@@ -11,18 +11,17 @@ pic_record_new(pic_state *pic, pic_value rectype)
|
||||
struct pic_record *rec;
|
||||
|
||||
rec = (struct pic_record *)pic_obj_alloc(pic, sizeof(struct pic_record), PIC_TT_RECORD);
|
||||
rec->rectype = rectype;
|
||||
xh_init_int(&rec->hash, sizeof(pic_value));
|
||||
|
||||
pic_record_set(pic, rec, pic_intern_cstr(pic, "@@type"), rectype);
|
||||
|
||||
return rec;
|
||||
}
|
||||
|
||||
pic_value
|
||||
pic_record_type(pic_state *pic, struct pic_record *rec)
|
||||
{
|
||||
UNUSED(pic);
|
||||
|
||||
return rec->rectype;
|
||||
return pic_record_ref(pic, rec, pic_intern_cstr(pic, "@@type"));
|
||||
}
|
||||
|
||||
pic_value
|
||||
|
||||
Reference in New Issue
Block a user