summaryrefslogtreecommitdiffhomepage
path: root/src/proc.c
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-11-01 16:12:57 +0800
committerDaniel Bovensiepen <[email protected]>2012-11-01 16:12:57 +0800
commitcdb72a05a294eb8521dd40c011160228496312cb (patch)
tree283586ad23f2dc6dfd1fd1aaa354f18c23d8c0d6 /src/proc.c
parent88dfaf19aa0808f78d13133d61ea433d043923f9 (diff)
parent57910ca5353e1feba1fb069a876b84a52f33d39f (diff)
downloadmruby-cdb72a05a294eb8521dd40c011160228496312cb.tar.gz
mruby-cdb72a05a294eb8521dd40c011160228496312cb.zip
Merge remote-tracking branch 'upstream/master' into mrbgems
Diffstat (limited to 'src/proc.c')
-rw-r--r--src/proc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/proc.c b/src/proc.c
index 0efc8d286..07834e86d 100644
--- a/src/proc.c
+++ b/src/proc.c
@@ -9,6 +9,10 @@
#include "mruby/class.h"
#include "opcode.h"
+static mrb_code call_iseq[] = {
+ MKOP_A(OP_CALL, 0),
+};
+
struct RProc *
mrb_proc_new(mrb_state *mrb, mrb_irep *irep)
{
@@ -144,14 +148,14 @@ void
mrb_init_proc(mrb_state *mrb)
{
struct RProc *m;
- mrb_code *call_iseq = (mrb_code *)mrb_alloca(mrb, sizeof(mrb_code));
mrb_irep *call_irep = (mrb_irep *)mrb_alloca(mrb, sizeof(mrb_irep));
+ static const mrb_irep mrb_irep_zero = { 0 };
if ( call_iseq == NULL || call_irep == NULL )
return;
- memset(call_irep, 0, sizeof(mrb_irep));
- *call_iseq = MKOP_A(OP_CALL, 0);
+ *call_irep = mrb_irep_zero;
+ call_irep->flags = MRB_ISEQ_NO_FREE;
call_irep->idx = -1;
call_irep->iseq = call_iseq;
call_irep->ilen = 1;