Skip to content

Commit 590d356

Browse files
committed
Block GC while we serialize, to be on the safe side. Sadly, doesn't eliminate the serializer segfault Rakudo's CORE.setting now triggers...
1 parent cca9005 commit 590d356

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/6model/serialization.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,9 @@ STRING * Serialization_serialize(PARROT_INTERP, PMC *sc, PMC *empty_string_heap)
848848
writer->write_ref = write_ref_func;
849849
writer->write_stable_ref = write_stable_ref_func;
850850

851+
/* Disable GC at this stage; the stuff hanging off writer isn't anchored. */
852+
Parrot_block_GC_mark(interp);
853+
851854
/* Other init. */
852855
smo_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "SixModelObject", 0));
853856
nqp_lexpad_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "NQPLexInfo", 0));
@@ -858,6 +861,9 @@ STRING * Serialization_serialize(PARROT_INTERP, PMC *sc, PMC *empty_string_heap)
858861

859862
/* Build a single result string out of the serialized data. */
860863
result = concatenate_outputs(interp, writer);
864+
865+
/* Re-enable GC. */
866+
Parrot_unblock_GC_mark(interp);
861867

862868
/* Clear up afterwards. */
863869
mem_sys_free(writer->root.dependencies_table);

0 commit comments

Comments
 (0)