struct M_Object_ {
m_bit* data;
Type type_ref;
-// Nspc nspc;//
Vector vtable;
- struct pool* p;
volatile size_t ref;
};
Func func;
Type base_type;
} d;
- struct pool* p;
size_t xid;
size_t size;
size_t array_depth;
stmt->value->type->nspc->info->class_data =
(m_bit*)xcalloc(1, stmt->value->type->nspc->info->class_data_size);
stmt->value->type->nspc->info->offset = stmt->s;
- if(!stmt->value->type->p)
- stmt->value->type->p = mp_ini(emit->gwion->p, (uint32_t)stmt->value->type->size);
Type_Decl *type_decl = new_type_decl(emit->gwion->p,
new_id_list(emit->gwion->p, stmt->xid, loc_cpy(emit->gwion->p, loc_cpy(emit->gwion->p, stmt_self(stmt)->pos))),
// emit->env->class_def ? ae_flag_member : 0);
stmt->type->nspc->info->class_data =
(m_bit*)xcalloc(1, stmt->type->nspc->info->class_data_size);
stmt->type->nspc->info->offset = stmt->s;
- if(!stmt->type->p)
- stmt->type->p = mp_ini(emit->gwion->p, (uint32_t)stmt->type->size);
scope = emit_push_type(emit, stmt->type);
} else if(emit->env->class_def) {
if(!GET_FLAG(l->self->d.exp_decl.list->self->value, member))
ANN m_int gwi_class_end(const Gwi gwi) {
if(!gwi->gwion->env->class_def)
ERR_B(gwi->loc, "import: too many class_end called.")
- const Type t = gwi->gwion->env->class_def;
- if(t->nspc && t->nspc->info->offset)
- t->p = mp_ini(gwi->gwion->p, (uint32_t)t->nspc->info->offset);
const Nspc nspc = gwi->gwion->env->class_def->nspc;
if(nspc->info->class_data_size && !nspc->info->class_data)
nspc->info->class_data = (m_bit*)xcalloc(1, nspc->info->class_data_size);
ANN void register_freearg(const Gwi gwi, const f_instr _exec, void(*_free)(const Instr, void*)) {
map_set(&gwi->gwion->freearg, (vtype)_exec, (vtype)_free);
-}
\ No newline at end of file
+}
a->type_ref = t;
a->vtable = &t->nspc->info->vtable;
if(t->nspc->info->offset) {
- Type type = t;
- while(!type->p)
- type = type->parent;
- a->p = type->p;
- a->data = (m_bit*)_mp_alloc2(type->p);
+// Type type = t;
+// while(!type->p)
+// type = type->parent;
+// a->p = type->p;
+ a->data = (m_bit*)_mp_alloc(p, t->nspc->info->offset);
}
if(shred)
vector_add(&shred->gc, (vtype)a);
}
ANN void free_object(MemPool p, const M_Object o) {
- if(o->data)
- _mp_free2(o->p, o->data);
+ if(o->type_ref->nspc->info->offset)
+ mp_free2(p, o->type_ref->nspc->info->offset, o->data);
mp_free(p, M_Object, o);
}
inherit(the_class);
if(class_def->body)
CHECK_BB(check_class_body(env, class_def))
- if(!the_class->p && the_class->nspc->info->offset)
- the_class->p = mp_ini(env->gwion->p, (uint32_t)the_class->nspc->info->offset);
SET_FLAG(the_class, checked | ae_flag_check);
return GW_OK;
}