diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-10-17 05:59:29 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-10-17 05:59:29 +0900 |
| commit | 8d977981b7d111989928f568463ea67599356f41 (patch) | |
| tree | dc08f0f18469b533eb37a38f309bd5e63a3c99d9 /src | |
| parent | 70abbb423a1b215563e6e4e58bfb76c02e59125d (diff) | |
| download | mruby-8d977981b7d111989928f568463ea67599356f41.tar.gz mruby-8d977981b7d111989928f568463ea67599356f41.zip | |
no memory copy for call_iseq
Diffstat (limited to 'src')
| -rw-r--r-- | src/proc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/proc.c b/src/proc.c index 0efc8d286..3321c2a91 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,13 @@ 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)); if ( call_iseq == NULL || call_irep == NULL ) return; memset(call_irep, 0, sizeof(mrb_irep)); - *call_iseq = MKOP_A(OP_CALL, 0); + call_irep->flags = MRB_ISEQ_NO_FREE; call_irep->idx = -1; call_irep->iseq = call_iseq; call_irep->ilen = 1; |
