Skip to content

Commit

Permalink
Move pool intialization into gc_ms.c from api.c
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/branches/gc_encapsulate_part2@43801 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
bacek committed Feb 9, 2010
1 parent 13a2d92 commit c2b77f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/gc/api.c
Expand Up @@ -318,17 +318,9 @@ Parrot_gc_initialize(PARROT_INTERP, ARGIN(void *stacktop))
{
ASSERT_ARGS(Parrot_gc_initialize)

interp->mem_pools = mem_allocate_zeroed_typed(Memory_Pools);
interp->gc_sys = mem_allocate_zeroed_typed(GC_Subsystem);

interp->mem_pools->num_sized = 0;
interp->mem_pools->num_attribs = 0;
interp->mem_pools->attrib_pools = NULL;
interp->mem_pools->sized_header_pools = NULL;

interp->lo_var_ptr = stacktop;


/*TODO: add ability to specify GC core at command line w/ --gc= */
if (0) /*If they chose sys_type with the --gc command line switch,*/
; /* set sys_type to value they gave */
Expand All @@ -347,11 +339,6 @@ Parrot_gc_initialize(PARROT_INTERP, ARGIN(void *stacktop))
/*die horribly because of invalid GC core specified*/
break;
}

initialize_var_size_pools(interp, interp->mem_pools);
initialize_fixed_size_pools(interp, interp->mem_pools);
Parrot_gc_initialize_fixed_size_pools(interp, interp->mem_pools,
GC_NUM_INITIAL_FIXED_SIZE_POOLS);
}

/*
Expand Down
9 changes: 9 additions & 0 deletions src/gc/gc_ms.c
Expand Up @@ -140,10 +140,19 @@ Parrot_gc_ms_init(PARROT_INTERP)
{
ASSERT_ARGS(Parrot_gc_ms_init)

interp->mem_pools = mem_allocate_zeroed_typed(Memory_Pools);
interp->mem_pools->num_sized = 0;
interp->mem_pools->num_attribs = 0;
interp->mem_pools->attrib_pools = NULL;
interp->mem_pools->sized_header_pools = NULL;

interp->gc_sys->do_gc_mark = gc_ms_mark_and_sweep;
interp->gc_sys->finalize_gc_system = NULL;
interp->gc_sys->init_pool = gc_ms_pool_init;

initialize_var_size_pools(interp, interp->mem_pools);
initialize_fixed_size_pools(interp, interp->mem_pools);
Parrot_gc_initialize_fixed_size_pools(interp, interp->mem_pools, GC_NUM_INITIAL_FIXED_SIZE_POOLS);
}

/*
Expand Down

0 comments on commit c2b77f9

Please sign in to comment.