Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Block GC while we serialize, to be on the safe side. Sadly, doesn't e…
…liminate the serializer segfault Rakudo's CORE.setting now triggers...
  • Loading branch information
jnthn committed Feb 25, 2012
1 parent cca9005 commit 590d356
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/6model/serialization.c
Expand Up @@ -848,6 +848,9 @@ STRING * Serialization_serialize(PARROT_INTERP, PMC *sc, PMC *empty_string_heap)
writer->write_ref = write_ref_func;
writer->write_stable_ref = write_stable_ref_func;

/* Disable GC at this stage; the stuff hanging off writer isn't anchored. */
Parrot_block_GC_mark(interp);

/* Other init. */
smo_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "SixModelObject", 0));
nqp_lexpad_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "NQPLexInfo", 0));
Expand All @@ -858,6 +861,9 @@ STRING * Serialization_serialize(PARROT_INTERP, PMC *sc, PMC *empty_string_heap)

/* Build a single result string out of the serialized data. */
result = concatenate_outputs(interp, writer);

/* Re-enable GC. */
Parrot_unblock_GC_mark(interp);

/* Clear up afterwards. */
mem_sys_free(writer->root.dependencies_table);
Expand Down

0 comments on commit 590d356

Please sign in to comment.