Merge pull request #325 from dcurrie/data-space-optimization
Reduce size of data object by removing unused dict field
This commit is contained in:
commit
2aa9e956c4
|
@ -4,12 +4,10 @@ struct pic_data *
|
||||||
pic_data_alloc(pic_state *pic, const pic_data_type *type, void *userdata)
|
pic_data_alloc(pic_state *pic, const pic_data_type *type, void *userdata)
|
||||||
{
|
{
|
||||||
struct pic_data *data;
|
struct pic_data *data;
|
||||||
struct pic_dict *storage = pic_make_dict(pic);
|
|
||||||
|
|
||||||
data = (struct pic_data *)pic_obj_alloc(pic, sizeof(struct pic_data), PIC_TT_DATA);
|
data = (struct pic_data *)pic_obj_alloc(pic, sizeof(struct pic_data), PIC_TT_DATA);
|
||||||
data->type = type;
|
data->type = type;
|
||||||
data->data = userdata;
|
data->data = userdata;
|
||||||
data->storage = storage;
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,7 +375,6 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||||
if (obj->u.data.type->mark) {
|
if (obj->u.data.type->mark) {
|
||||||
obj->u.data.type->mark(pic, obj->u.data.data, gc_mark);
|
obj->u.data.type->mark(pic, obj->u.data.data, gc_mark);
|
||||||
}
|
}
|
||||||
LOOP(obj->u.data.storage);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PIC_TT_DICT: {
|
case PIC_TT_DICT: {
|
||||||
|
|
|
@ -18,7 +18,6 @@ typedef struct {
|
||||||
struct pic_data {
|
struct pic_data {
|
||||||
PIC_OBJECT_HEADER
|
PIC_OBJECT_HEADER
|
||||||
const pic_data_type *type;
|
const pic_data_type *type;
|
||||||
struct pic_dict *storage;
|
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue