Skip to content

Commit 67337e1

Browse files
committed
Add visit, which should in theory mean all the state of this PMC gets serialized.
1 parent 5c2b972 commit 67337e1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/pmc/nqplexinfo.pmc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ pmclass NQPLexInfo provides hash auto_attrs dynpmc group nqp {
4343
PObj_custom_mark_SET(SELF);
4444
}
4545

46+
VTABLE void mark() {
47+
PMC *name_to_register_map, *static_values;
48+
PMC *static_slots_cache, *static_values_cache;
49+
GET_ATTR_name_to_register_map(INTERP, SELF, name_to_register_map);
50+
Parrot_gc_mark_PMC_alive(INTERP, name_to_register_map);
51+
GET_ATTR_static_values(INTERP, SELF, static_values);
52+
Parrot_gc_mark_PMC_alive(INTERP, static_values);
53+
GET_ATTR_static_slots_cache(INTERP, SELF, static_slots_cache);
54+
Parrot_gc_mark_PMC_alive(INTERP, static_slots_cache);
55+
GET_ATTR_static_values_cache(INTERP, SELF, static_values_cache);
56+
Parrot_gc_mark_PMC_alive(INTERP, static_values_cache);
57+
}
58+
4659
VTABLE INTVAL get_integer_keyed_str(STRING *key) {
4760
PMC *name_to_register_map;
4861
GET_ATTR_name_to_register_map(INTERP, SELF, name_to_register_map);
@@ -60,6 +73,22 @@ pmclass NQPLexInfo provides hash auto_attrs dynpmc group nqp {
6073
GET_ATTR_name_to_register_map(INTERP, SELF, name_to_register_map);
6174
VTABLE_set_integer_keyed_str(interp, name_to_register_map, key, value);
6275
}
76+
77+
VTABLE void visit(PMC *info) {
78+
VISIT_PMC_ATTR(INTERP, info, SELF, NQPLexInfo, name_to_register_map);
79+
VISIT_PMC_ATTR(INTERP, info, SELF, NQPLexInfo, static_values);
80+
VISIT_PMC_ATTR(INTERP, info, SELF, NQPLexInfo, static_slots_cache);
81+
VISIT_PMC_ATTR(INTERP, info, SELF, NQPLexInfo, static_values_cache);
82+
SUPER(info);
83+
}
84+
85+
VTABLE void freeze(PMC *info) {
86+
SUPER(info);
87+
}
88+
89+
VTABLE void thaw(PMC *info) {
90+
SUPER(info);
91+
}
6392

6493
/*
6594

0 commit comments

Comments
 (0)