Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add slots in the SC for holding object repossession info.
  • Loading branch information
jnthn committed Feb 28, 2012
1 parent d770a5a commit f9eb249
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/pmc/serializationcontext.pmc
Expand Up @@ -21,13 +21,23 @@ pmclass SerializationContext auto_attrs dynpmc group nqp {
/* Description (probably the file name) if any. */
ATTR STRING *description;

/* Repossession info. The following RIA and RPA have matching indexes, each
* representing the integer of an object in our root set along with the SC
* that the object was originally from. */
ATTR PMC *rep_indexes;
ATTR PMC *rep_scs;

VTABLE void init() {
PMC *root_objects = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
PMC *root_stables = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
PMC *root_codes = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
PMC *rep_indexes = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
PMC *rep_scs = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
SET_ATTR_root_objects(interp, SELF, root_objects);
SET_ATTR_root_stables(interp, SELF, root_stables);
SET_ATTR_root_codes(interp, SELF, root_codes);
SET_ATTR_rep_indexes(interp, SELF, rep_indexes);
SET_ATTR_rep_scs(interp, SELF, rep_scs);
PObj_custom_mark_SET(SELF);
if (!smo_id)
smo_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "SixModelObject", 0));
Expand All @@ -38,7 +48,7 @@ pmclass SerializationContext auto_attrs dynpmc group nqp {
}

VTABLE void mark() {
PMC *root_objects, *root_stables, *root_codes;
PMC *root_objects, *root_stables, *root_codes, *rep_indexes, *rep_scs;
STRING *handle, *description;
GET_ATTR_root_objects(interp, SELF, root_objects);
Parrot_gc_mark_PMC_alive(INTERP, root_objects);
Expand All @@ -50,6 +60,10 @@ pmclass SerializationContext auto_attrs dynpmc group nqp {
Parrot_gc_mark_STRING_alive(INTERP, handle);
GET_ATTR_description(interp, SELF, description);
Parrot_gc_mark_STRING_alive(INTERP, description);
GET_ATTR_rep_indexes(interp, SELF, rep_indexes);
Parrot_gc_mark_PMC_alive(INTERP, rep_indexes);
GET_ATTR_rep_scs(interp, SELF, rep_scs);
Parrot_gc_mark_PMC_alive(INTERP, rep_scs);
}

VTABLE PMC* get_pmc_keyed_int(INTVAL idx) {
Expand Down

0 comments on commit f9eb249

Please sign in to comment.