Merge pull request #325 from dcurrie/data-space-optimization

Reduce size of data object by removing unused dict field
This commit is contained in:
Yuichi Nishiwaki 2016-01-31 17:19:02 +09:00
commit 2aa9e956c4
3 changed files with 0 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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: {

View File

@ -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;
}; };