Changeset 331 for EcnlProtoTool/trunk/mruby-1.3.0/src/state.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/src/state.c
r321 r331 7 7 #include <stdlib.h> 8 8 #include <string.h> 9 #include "mruby.h"10 #include "mruby/irep.h"11 #include "mruby/variable.h"12 #include "mruby/debug.h"13 #include "mruby/string.h"9 #include <mruby.h> 10 #include <mruby/irep.h> 11 #include <mruby/variable.h> 12 #include <mruby/debug.h> 13 #include <mruby/string.h> 14 14 15 15 void mrb_init_core(mrb_state*); … … 142 142 if (!(irep->flags & MRB_ISEQ_NO_FREE)) 143 143 mrb_free(mrb, irep->iseq); 144 for (i=0; i<irep->plen; i++) {144 if (irep->pool) for (i=0; i<irep->plen; i++) { 145 145 if (mrb_type(irep->pool[i]) == MRB_TT_STRING) { 146 146 mrb_gc_free_str(mrb, RSTRING(irep->pool[i])); … … 160 160 mrb_free(mrb, irep->reps); 161 161 mrb_free(mrb, irep->lv); 162 mrb_free(mrb, (void *)irep->filename); 162 if (irep->own_filename) { 163 mrb_free(mrb, (void *)irep->filename); 164 } 163 165 mrb_free(mrb, irep->lines); 164 166 mrb_debug_info_free(mrb, irep->debug_info); … … 216 218 } 217 219 220 void mrb_free_backtrace(mrb_state *mrb); 221 218 222 MRB_API void 219 223 mrb_free_context(mrb_state *mrb, struct mrb_context *c) … … 259 263 *irep = mrb_irep_zero; 260 264 irep->refcnt = 1; 265 irep->own_filename = FALSE; 261 266 262 267 return irep; … … 287 292 if (mrb->atexit_stack_len == 0) { 288 293 mrb->atexit_stack = (mrb_atexit_func*)mrb_malloc(mrb, stack_size); 289 } else { 294 } 295 else { 290 296 mrb->atexit_stack = (mrb_atexit_func*)mrb_realloc(mrb, mrb->atexit_stack, stack_size); 291 297 }
Note:
See TracChangeset
for help on using the changeset viewer.