diff --git a/src/interp/inter_create.c b/src/interp/inter_create.c index 654cde2cc4..d1a745670a 100644 --- a/src/interp/inter_create.c +++ b/src/interp/inter_create.c @@ -144,6 +144,14 @@ make_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) MUTEX_INIT(interpreter_array_mutex); } + /* Must initialize flags before Parrot_gc_initialize() is called + * so the GC_DEBUG stuff is available. */ + interp->flags = flags; + /* Set up the memory allocation system */ + Parrot_gc_initialize(interp, (void*)&stacktop); + Parrot_block_GC_mark(interp); + Parrot_block_GC_sweep(interp); + create_initial_context(interp); interp->resume_flag = RESUME_INITIAL; @@ -151,10 +159,6 @@ make_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) CONTEXT(interp)->recursion_depth = (UINTVAL)-1; interp->recursion_limit = RECURSION_LIMIT; - /* Must initialize flags here so the GC_DEBUG stuff is available before - * Parrot_gc_initialize() is called. */ - interp->flags = flags; - /* PANIC will fail until this is done */ interp->piodata = NULL; Parrot_io_init(interp); @@ -168,11 +172,6 @@ make_interpreter(ARGIN_NULLOK(Interp *parent), INTVAL flags) #endif } - /* Set up the memory allocation system */ - Parrot_gc_initialize(interp, (void*)&stacktop); - Parrot_block_GC_mark(interp); - Parrot_block_GC_sweep(interp); - /* * Set up the string subsystem * This also generates the constant string tables