diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-07-08 19:40:17 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-07-08 19:40:17 -0700 |
| commit | 8cef93d228ec5d2cb57b84cf0ae3945363080546 (patch) | |
| tree | 1b9b689e93466c56e0badf7dbe373d7ce96d6867 /src/state.c | |
| parent | 78614b2391aec299d3be181ec14671d037bf67b1 (diff) | |
| parent | 611cf71a10051d77a7bb8998d8a7c34e26b0b1b0 (diff) | |
| download | mruby-8cef93d228ec5d2cb57b84cf0ae3945363080546.tar.gz mruby-8cef93d228ec5d2cb57b84cf0ae3945363080546.zip | |
Merge pull request #355 from monaka/pr-use-mrb_calloc
Use mrb_calloc if you want zero cleard buffers.
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c index e4729ca70..7f74606ff 100644 --- a/src/state.c +++ b/src/state.c @@ -76,8 +76,7 @@ mrb_add_irep(mrb_state *mrb, int idx) int max = 256; if (idx > max) max = idx+1; - mrb->irep = mrb_malloc(mrb, sizeof(mrb_irep*)*max); - memset(mrb->irep, 0, sizeof(mrb_irep*)*max); + mrb->irep = mrb_calloc(mrb, max, sizeof(mrb_irep*)); mrb->irep_capa = max; } else if (mrb->irep_capa <= idx) { |
