Skip to content

Commit

Permalink
[core] initialize gc subsystem before contexts and pio
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@40385 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
NotFound authored and NotFound committed Aug 2, 2009
1 parent 8ff1c10 commit d80785a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/interp/inter_create.c
Expand Up @@ -144,17 +144,21 @@ 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;

/* main is called as a Sub too - this will get depth 0 then */
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);
Expand All @@ -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
Expand Down

0 comments on commit d80785a

Please sign in to comment.