diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-09 11:42:24 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-09 11:42:24 +0900 |
| commit | c3201370554a5d48c59f97daf61a725310d4bbbc (patch) | |
| tree | 061650ef60a9d2b30929f1b3782911ea45f53e53 /src/vm.c | |
| parent | 0e2a81740a284e823894ec5b1d804e282df15b7e (diff) | |
| parent | 8cef93d228ec5d2cb57b84cf0ae3945363080546 (diff) | |
| download | mruby-c3201370554a5d48c59f97daf61a725310d4bbbc.tar.gz mruby-c3201370554a5d48c59f97daf61a725310d4bbbc.zip | |
Merge branch 'master' of github.com:mruby/mruby
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -28,16 +28,14 @@ static void stack_init(mrb_state *mrb) { /* assert(mrb->stack == NULL); */ - mrb->stbase = mrb_malloc(mrb, sizeof(mrb_value) * STACK_INIT_SIZE); - memset(mrb->stbase, 0, sizeof(mrb_value) * STACK_INIT_SIZE); + mrb->stbase = mrb_calloc(mrb, STACK_INIT_SIZE, sizeof(mrb_value)); mrb->stend = mrb->stbase + STACK_INIT_SIZE; mrb->stack = mrb->stbase; /* assert(mrb->ci == NULL); */ - mrb->cibase = mrb_malloc(mrb, sizeof(mrb_callinfo)*CALLINFO_INIT_SIZE); + mrb->cibase = mrb_calloc(mrb, CALLINFO_INIT_SIZE, sizeof(mrb_callinfo)); mrb->ciend = mrb->cibase + CALLINFO_INIT_SIZE; mrb->ci = mrb->cibase; - memset(mrb->ci, 0, sizeof(mrb_callinfo)); mrb->ci->target_class = mrb->object_class; } |
