use mrb_malloc instead of malloc

This commit is contained in:
takahashim
2012-06-02 01:14:45 +09:00
parent cd48737e11
commit 49df217957
+1 -1
View File
@@ -416,7 +416,7 @@ mrb_struct_initialize_withArg(mrb_state *mrb, int argc, mrb_value *argv, mrb_val
mrb_raise(mrb, E_ARGUMENT_ERROR, "struct size differs");
}
st = RSTRUCT(self);
st->ptr = malloc(sizeof(mrb_value)*argc);
st->ptr = mrb_malloc(mrb, sizeof(mrb_value)*argc);
st->len = n;
memcpy(st->ptr, argv, sizeof(mrb_value)*argc);
//if (n > argc) {