Ticket #1062: obj_alive.patch
File obj_alive.patch, 33.4 KB (added by NotFound, 12 years ago) |
---|
-
src/pmc/role.pmc
256 256 VTABLE void mark() { 257 257 Parrot_Role_attributes * const role = PARROT_ROLE(SELF); 258 258 259 if (role->name) 260 Parrot_gc_mark_PObj_alive(interp, (PObj *)role->name); 261 if (role->_namespace) 262 Parrot_gc_mark_PObj_alive(interp, (PObj *)role->_namespace); 263 if (role->roles) 264 Parrot_gc_mark_PObj_alive(interp, (PObj *)role->roles); 265 if (role->methods) 266 Parrot_gc_mark_PObj_alive(interp, (PObj *)role->methods); 267 if (role->attrib_metadata) 268 Parrot_gc_mark_PObj_alive(interp, (PObj *)role->attrib_metadata); 259 Parrot_gc_mark_STRING_alive(interp, role->name); 260 Parrot_gc_mark_PMC_alive(interp, role->_namespace); 261 Parrot_gc_mark_PMC_alive(interp, role->roles); 262 Parrot_gc_mark_PMC_alive(interp, role->methods); 263 Parrot_gc_mark_PMC_alive(interp, role->attrib_metadata); 269 264 } 270 265 271 266 /* -
src/pmc/packfilesegment.pmc
63 63 Parrot_PackfileSegment_attributes * attrs = 64 64 PARROT_PACKFILESEGMENT(SELF); 65 65 66 if (!PMC_IS_NULL(attrs->directory)) 67 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->directory); 66 Parrot_gc_mark_PMC_alive(interp, attrs->directory); 68 67 } 69 68 70 69 /* -
src/pmc/packfilefixuptable.pmc
61 61 Parrot_PackfileFixupTable_attributes * attrs = 62 62 PARROT_PACKFILEFIXUPTABLE(SELF); 63 63 64 if (!PMC_IS_NULL(attrs->entries)) 65 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->entries); 64 Parrot_gc_mark_PMC_alive(interp, attrs->entries); 66 65 67 66 SUPER(); 68 67 } -
src/pmc/class.pmc
589 589 590 590 VTABLE void mark() { 591 591 Parrot_Class_attributes * const _class = PARROT_CLASS(SELF); 592 if (_class->name) 593 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->name); 594 if (_class->fullname) 595 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->fullname); 596 if (_class->_namespace) 597 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->_namespace); 598 if (_class->parents) 599 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->parents); 600 if (_class->all_parents) 601 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->all_parents); 602 if (_class->roles) 603 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->roles); 604 if (_class->methods) 605 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->methods); 606 if (_class->vtable_overrides) 607 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->vtable_overrides); 608 if (_class->parent_overrides) 609 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->parent_overrides); 610 if (_class->attrib_metadata) 611 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->attrib_metadata); 612 if (_class->attrib_index) 613 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->attrib_index); 614 if (_class->attrib_cache) 615 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->attrib_cache); 616 if (_class->resolve_method) 617 Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->resolve_method); 592 Parrot_gc_mark_STRING_alive(interp, _class->name); 593 Parrot_gc_mark_STRING_alive(interp, _class->fullname); 594 Parrot_gc_mark_PMC_alive(interp, _class->_namespace); 595 Parrot_gc_mark_PMC_alive(interp, _class->parents); 596 Parrot_gc_mark_PMC_alive(interp, _class->all_parents); 597 Parrot_gc_mark_PMC_alive(interp, _class->roles); 598 Parrot_gc_mark_PMC_alive(interp, _class->methods); 599 Parrot_gc_mark_PMC_alive(interp, _class->vtable_overrides); 600 Parrot_gc_mark_PMC_alive(interp, _class->parent_overrides); 601 Parrot_gc_mark_PMC_alive(interp, _class->attrib_metadata); 602 Parrot_gc_mark_PMC_alive(interp, _class->attrib_index); 603 Parrot_gc_mark_PMC_alive(interp, _class->attrib_cache); 604 Parrot_gc_mark_PMC_alive(interp, _class->resolve_method); 618 605 } 619 606 620 607 -
src/pmc/string.pmc
75 75 VTABLE void mark() { 76 76 STRING *str_val; 77 77 GET_ATTR_str_val(INTERP, SELF, str_val); 78 79 if (str_val) 80 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)str_val); 78 Parrot_gc_mark_STRING_alive(INTERP, str_val); 81 79 } 82 80 83 81 /* -
src/pmc/object.pmc
190 190 if (PARROT_OBJECT(SELF)) { 191 191 Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF); 192 192 193 if (obj->_class) 194 Parrot_gc_mark_PObj_alive(interp, (PObj*)obj->_class); 195 if (obj->attrib_store) 196 Parrot_gc_mark_PObj_alive(interp, (PObj*)obj->attrib_store); 193 Parrot_gc_mark_PMC_alive(interp, obj->_class); 194 Parrot_gc_mark_PMC_alive(interp, obj->attrib_store); 197 195 } 198 196 } 199 197 -
src/pmc/exporter.pmc
134 134 GET_ATTR_ns_dest(INTERP, SELF, ns_dest); 135 135 GET_ATTR_globals(INTERP, SELF, globals); 136 136 137 if (ns_src) 138 Parrot_gc_mark_PObj_alive(interp, (PObj *)ns_src); 139 if (ns_dest) 140 Parrot_gc_mark_PObj_alive(interp, (PObj *)ns_dest); 141 if (globals) 142 Parrot_gc_mark_PObj_alive(interp, (PObj *)globals); 137 Parrot_gc_mark_PMC_alive(interp, ns_src); 138 Parrot_gc_mark_PMC_alive(interp, ns_dest); 139 Parrot_gc_mark_PMC_alive(interp, globals); 143 140 } 144 141 145 142 -
src/pmc/eventhandler.pmc
123 123 Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF); 124 124 125 125 if (e) { 126 if (e->type) 127 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->type); 126 Parrot_gc_mark_STRING_alive(INTERP, e->type); 127 Parrot_gc_mark_PMC_alive(INTERP, e->interp); 128 Parrot_gc_mark_PMC_alive(INTERP, e->code); 128 129 129 if (! PMC_IS_NULL(e->interp))130 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->interp);131 132 if (! PMC_IS_NULL(e->code))133 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->code);134 135 130 SUPER(); 136 131 } 137 132 } -
src/pmc/cpointer.pmc
84 84 if (sig) { 85 85 void *pointer; 86 86 GET_ATTR_pointer(INTERP, SELF, pointer); 87 Parrot_gc_mark_ PObj_alive(interp, (PObj *)sig);87 Parrot_gc_mark_STRING_alive(interp, sig); 88 88 89 89 if (pointer) { 90 90 if (Parrot_str_equal(interp, sig, CONST_STRING(interp, "P"))) { 91 91 PMC ** const pmc_pointer = (PMC **) pointer; 92 92 PARROT_ASSERT(*pmc_pointer); 93 Parrot_gc_mark_P Obj_alive(interp, (PObj *)*pmc_pointer);93 Parrot_gc_mark_PMC_alive(interp, *pmc_pointer); 94 94 } 95 95 else if (Parrot_str_equal(interp, sig, CONST_STRING(interp, "S"))) { 96 96 STRING ** const str_pointer = (STRING **) pointer; 97 97 PARROT_ASSERT(*str_pointer); 98 Parrot_gc_mark_ PObj_alive(interp, (PObj *)*str_pointer);98 Parrot_gc_mark_STRING_alive(interp, *str_pointer); 99 99 } 100 100 } 101 101 } -
src/pmc/filehandle.pmc
119 119 120 120 VTABLE void mark() { 121 121 Parrot_FileHandle_attributes * const data_struct = PARROT_FILEHANDLE(SELF); 122 if (data_struct->mode) 123 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->mode); 124 if (data_struct->filename) 125 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->filename); 126 if (data_struct->encoding) 127 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->encoding); 122 Parrot_gc_mark_STRING_alive(interp, data_struct->mode); 123 Parrot_gc_mark_STRING_alive(interp, data_struct->filename); 124 Parrot_gc_mark_STRING_alive(interp, data_struct->encoding); 128 125 } 129 126 130 127 /* -
src/pmc/packfileannotations.pmc
72 72 Parrot_PackfileAnnotations_attributes * attrs = 73 73 PARROT_PACKFILEANNOTATIONS(SELF); 74 74 75 if (!PMC_IS_NULL(attrs->const_table))76 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->const_table);75 Parrot_gc_mark_PMC_alive(interp, attrs->const_table); 76 Parrot_gc_mark_PMC_alive(interp, attrs->annotations); 77 77 78 if (!PMC_IS_NULL(attrs->annotations))79 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->annotations);80 81 78 SUPER(); 82 79 } 83 80 -
src/pmc/exception.pmc
149 149 150 150 VTABLE void mark() { 151 151 Parrot_Exception_attributes * const core_struct = PARROT_EXCEPTION(SELF); 152 if (core_struct->message) 153 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->message); 154 if (core_struct->payload) 155 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->payload); 156 if (core_struct->resume) 157 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->resume); 158 if (core_struct->backtrace) 159 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->backtrace); 160 if (core_struct->handler_iter) 161 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handler_iter); 162 if (core_struct->handler_ctx) 163 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handler_ctx); 164 if (core_struct->thrower) 165 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->thrower); 152 Parrot_gc_mark_STRING_alive(interp, core_struct->message); 153 Parrot_gc_mark_PMC_alive(interp, core_struct->payload); 154 Parrot_gc_mark_PMC_alive(interp, core_struct->resume); 155 Parrot_gc_mark_PMC_alive(interp, core_struct->backtrace); 156 Parrot_gc_mark_PMC_alive(interp, core_struct->handler_iter); 157 Parrot_gc_mark_PMC_alive(interp, core_struct->handler_ctx); 158 Parrot_gc_mark_PMC_alive(interp, core_struct->thrower); 166 159 } 167 160 168 161 /* -
src/pmc/task.pmc
375 375 if (PARROT_TASK(SELF)) { 376 376 Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF); 377 377 378 if (core_struct->codeblock) 379 Parrot_gc_mark_PObj_alive(interp, (PObj*)core_struct->codeblock); 380 if (core_struct->data) 381 Parrot_gc_mark_PObj_alive(interp, (PObj*)core_struct->data); 378 Parrot_gc_mark_STRING_alive(interp, core_struct->type); 379 Parrot_gc_mark_STRING_alive(interp, core_struct->subtype); 380 Parrot_gc_mark_STRING_alive(interp, core_struct->status); 381 Parrot_gc_mark_PMC_alive(interp, core_struct->codeblock); 382 Parrot_gc_mark_PMC_alive(interp, core_struct->data); 382 383 } 383 384 } 384 385 -
src/pmc/orderedhashiterator.pmc
65 65 66 66 VTABLE void mark() { 67 67 PMC * const hash = PARROT_ORDEREDHASHITERATOR(SELF)->pmc_hash; 68 if (hash) 69 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)hash); 68 Parrot_gc_mark_PMC_alive(INTERP, hash); 70 69 } 71 70 72 71 /* -
src/pmc/continuation.pmc
131 131 if (!cc) 132 132 return; 133 133 134 if (cc->to_ctx) 135 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) cc->to_ctx); 136 if (cc->from_ctx) 137 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) cc->from_ctx); 134 Parrot_gc_mark_PMC_alive(INTERP, cc->to_ctx); 135 Parrot_gc_mark_PMC_alive(INTERP, cc->from_ctx); 138 136 } 139 137 140 138 /* -
src/pmc/packfile.pmc
95 95 VTABLE void mark() { 96 96 Parrot_Packfile_attributes * attrs = PARROT_PACKFILE(SELF); 97 97 98 if (attrs->uuid) 99 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)attrs->uuid); 100 if (!PMC_IS_NULL(attrs->directory)) 101 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)attrs->directory); 98 Parrot_gc_mark_STRING_alive(INTERP, attrs->uuid); 99 Parrot_gc_mark_PMC_alive(INTERP, attrs->directory); 102 100 } 103 101 /* 104 102 -
src/pmc/stringiterator.pmc
59 59 VTABLE void mark() { 60 60 PMC *string; 61 61 GET_ATTR_string(INTERP, SELF, string); 62 if (string) 63 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)string); 62 Parrot_gc_mark_PMC_alive(INTERP, string); 64 63 } 65 64 66 65 /* -
src/pmc/socket.pmc
94 94 Parrot_Socket_attributes * const data = PARROT_SOCKET(SELF); 95 95 96 96 if (data) { 97 if (data->local) 98 Parrot_gc_mark_PObj_alive(interp, (PObj *)data->local); 99 100 if (data->remote) 101 Parrot_gc_mark_PObj_alive(interp, (PObj *)data->remote); 97 Parrot_gc_mark_PMC_alive(interp, data->local); 98 Parrot_gc_mark_PMC_alive(interp, data->remote); 102 99 } 103 100 } 104 101 /* -
src/pmc/hashiterator.pmc
126 126 127 127 VTABLE void mark() { 128 128 PMC *hash = PARROT_HASHITERATOR(SELF)->pmc_hash; 129 if (hash) 130 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)hash); 129 Parrot_gc_mark_PMC_alive(INTERP, hash); 131 130 /* We don't mark underlying parrot_hash. Hash PMC will mark it */ 132 131 } 133 132 -
src/pmc/fixedpmcarray.pmc
787 787 return; 788 788 789 789 for (i = PMC_size(SELF) - 1; i >= 0; --i) 790 if (data[i]) 791 Parrot_gc_mark_PObj_alive(interp, (PObj *)data[i]); 790 Parrot_gc_mark_PMC_alive(interp, data[i]); 792 791 } 793 792 794 793 -
src/pmc/packfileconstanttable.pmc
66 66 Parrot_PackfileConstantTable_attributes * attrs = 67 67 PARROT_PACKFILECONSTANTTABLE(SELF); 68 68 69 if (!PMC_IS_NULL(attrs->constants)) 70 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->constants); 71 if (!PMC_IS_NULL(attrs->types)) 72 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->types); 69 Parrot_gc_mark_PMC_alive(interp, attrs->constants); 70 Parrot_gc_mark_PMC_alive(interp, attrs->types); 73 71 74 72 SUPER(); 75 73 } -
src/pmc/unmanagedstruct.pmc
739 739 */ 740 740 741 741 VTABLE void mark() { 742 if (PARROT_UNMANAGEDSTRUCT(SELF)->init)743 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)PARROT_UNMANAGEDSTRUCT(SELF)->init);742 PMC *init = PARROT_UNMANAGEDSTRUCT(SELF)->init; 743 Parrot_gc_mark_PMC_alive(INTERP, init); 744 744 } 745 745 746 746 /* -
src/pmc/packfilerawsegment.pmc
64 64 Parrot_PackfileRawSegment_attributes * attrs = 65 65 PARROT_PACKFILERAWSEGMENT(SELF); 66 66 67 if (!PMC_IS_NULL(attrs->opcodes)) 68 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->opcodes); 67 Parrot_gc_mark_PMC_alive(interp, attrs->opcodes); 69 68 70 69 SUPER(); 71 70 } -
src/pmc/packfilefixupentry.pmc
57 57 Parrot_PackfileFixupEntry_attributes * attrs = 58 58 PARROT_PACKFILEFIXUPENTRY(SELF); 59 59 60 if (attrs->name) 61 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->name); 60 Parrot_gc_mark_STRING_alive(interp, attrs->name); 62 61 } 63 62 64 63 /* -
src/pmc/scheduler.pmc
266 266 if (PARROT_SCHEDULER(SELF)) { 267 267 Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF); 268 268 269 if (core_struct->task_list) 270 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->task_list); 271 if (core_struct->task_index) 272 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->task_index); 273 if (core_struct->wait_index) 274 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->wait_index); 275 if (core_struct->handlers) 276 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handlers); 277 if (core_struct->messages) 278 Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->messages); 269 Parrot_gc_mark_PMC_alive(interp, core_struct->task_list); 270 Parrot_gc_mark_PMC_alive(interp, core_struct->task_index); 271 Parrot_gc_mark_PMC_alive(interp, core_struct->wait_index); 272 Parrot_gc_mark_PMC_alive(interp, core_struct->handlers); 273 Parrot_gc_mark_PMC_alive(interp, core_struct->messages); 279 274 } 280 275 } 281 276 -
src/pmc/exceptionhandler.pmc
68 68 VTABLE void mark() { 69 69 Parrot_ExceptionHandler_attributes * const attrs = 70 70 PARROT_EXCEPTIONHANDLER(SELF); 71 if (attrs->handled_types) 72 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->handled_types); 73 if (attrs->handled_types_except) 74 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->handled_types_except); 71 Parrot_gc_mark_PMC_alive(interp, attrs->handled_types); 72 Parrot_gc_mark_PMC_alive(interp, attrs->handled_types_except); 75 73 SUPER(); 76 74 } 77 75 -
src/pmc/namespace.pmc
162 162 VTABLE void mark() { 163 163 Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF); 164 164 SUPER(); 165 if (nsinfo->parent) 166 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->parent); 167 if (nsinfo->name) 168 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->name); 169 if (nsinfo->_class) 170 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->_class); 171 if (nsinfo->vtable) 172 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->vtable); 173 if (nsinfo->methods) 174 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->methods); 165 Parrot_gc_mark_PMC_alive(INTERP, nsinfo->parent); 166 Parrot_gc_mark_STRING_alive(INTERP, nsinfo->name); 167 Parrot_gc_mark_PMC_alive(INTERP, nsinfo->_class); 168 Parrot_gc_mark_PMC_alive(INTERP, nsinfo->vtable); 169 Parrot_gc_mark_PMC_alive(INTERP, nsinfo->methods); 175 170 } 176 171 177 172 /* -
src/pmc/packfiledirectory.pmc
61 61 Parrot_PackfileDirectory_attributes * attrs = 62 62 PARROT_PACKFILEDIRECTORY(SELF); 63 63 64 if (!PMC_IS_NULL(attrs->hash)) 65 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->hash); 64 Parrot_gc_mark_PMC_alive(interp, attrs->hash); 66 65 67 66 SUPER(); 68 67 } -
src/pmc/nci.pmc
232 232 if (PARROT_NCI(SELF)) { 233 233 Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF); 234 234 235 if (nci_info->signature) 236 Parrot_gc_mark_PObj_alive(interp, (PObj*)nci_info->signature); 237 if (nci_info->pcc_params_signature) 238 Parrot_gc_mark_PObj_alive(interp, (PObj*)nci_info->pcc_params_signature); 239 if (nci_info->long_signature) 240 Parrot_gc_mark_PObj_alive(interp, (PObj*)nci_info->long_signature); 241 if (nci_info->multi_sig) 242 Parrot_gc_mark_PObj_alive(interp, (PObj*)nci_info->multi_sig); 235 Parrot_gc_mark_STRING_alive(interp, nci_info->signature); 236 Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature); 237 Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature); 238 Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig); 243 239 } 244 240 } 245 241 -
src/pmc/packfileannotation.pmc
60 60 Parrot_PackfileAnnotation_attributes * attrs = 61 61 PARROT_PACKFILEANNOTATION(SELF); 62 62 63 if (attrs->name) 64 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->name); 65 if ((attrs->value_type == PF_ANNOTATION_KEY_TYPE_STR) && attrs->str_value) 66 Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->str_value); 63 Parrot_gc_mark_STRING_alive(interp, attrs->name); 64 Parrot_gc_mark_STRING_alive(interp, attrs->str_value); 67 65 } 68 66 69 67 -
src/pmc/stringhandle.pmc
120 120 121 121 VTABLE void mark() { 122 122 Parrot_StringHandle_attributes * const data_struct = PARROT_STRINGHANDLE(SELF); 123 if (data_struct->stringhandle) 124 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->stringhandle); 125 if (data_struct->mode) 126 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->mode); 127 if (data_struct->encoding) 128 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->encoding); 129 if (data_struct->filename) 130 Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->filename); 123 Parrot_gc_mark_STRING_alive(interp, data_struct->stringhandle); 124 Parrot_gc_mark_STRING_alive(interp, data_struct->mode); 125 Parrot_gc_mark_STRING_alive(interp, data_struct->encoding); 126 Parrot_gc_mark_STRING_alive(interp, data_struct->filename); 131 127 } 132 128 133 129 /* -
src/pmc/schedulermessage.pmc
199 199 Parrot_SchedulerMessage_attributes * const core_struct = 200 200 PARROT_SCHEDULERMESSAGE(SELF); 201 201 202 if (core_struct->data)203 Parrot_gc_mark_PObj_alive(interp, (PObj*)core_struct->data);202 Parrot_gc_mark_STRING_alive(interp, core_struct->type); 203 Parrot_gc_mark_PMC_alive(interp, core_struct->data); 204 204 } 205 205 } 206 206 -
src/pmc/fixedstringarray.pmc
118 118 GET_ATTR_size(INTERP, SELF, size); 119 119 120 120 for (i = 0; i < size; i++) { 121 if (str_array[i]) 122 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) str_array[i]); 121 Parrot_gc_mark_STRING_alive(INTERP, str_array[i]); 123 122 } 124 123 } 125 124 } -
src/pmc/eval.pmc
119 119 opcode_t ci = e->offset; 120 120 PMC *sub = ct->constants[ci]->u.key; 121 121 122 if (!PMC_IS_NULL(sub)) 123 Parrot_gc_mark_PObj_alive(interp, (PObj *)sub); 122 Parrot_gc_mark_PMC_alive(interp, sub); 124 123 } 125 124 } 126 125 } -
src/pmc/arrayiterator.pmc
109 109 VTABLE void mark() { 110 110 PMC *array; 111 111 GET_ATTR_array(INTERP, SELF, array); 112 if (array) 113 Parrot_gc_mark_PObj_alive(INTERP, (PObj *)array); 112 Parrot_gc_mark_PMC_alive(INTERP, array); 114 113 } 115 114 116 115 /* -
src/pmc/sub.pmc
571 571 if (!sub) 572 572 return; 573 573 574 if (sub->name) 575 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->name); 576 if (sub->method_name) 577 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->method_name); 578 if (sub->ns_entry_name) 579 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->ns_entry_name); 580 if (!PMC_IS_NULL(sub->namespace_name)) 581 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->namespace_name); 582 if (!PMC_IS_NULL(sub->namespace_stash)) 583 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->namespace_stash); 584 if (!PMC_IS_NULL(sub->multi_signature)) 585 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->multi_signature); 586 if (!PMC_IS_NULL(sub->lex_info)) 587 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->lex_info); 588 if (!PMC_IS_NULL(sub->outer_sub)) 589 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->outer_sub); 590 if (!PMC_IS_NULL(sub->eval_pmc)) 591 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->eval_pmc); 592 if (sub->subid) 593 Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->subid); 594 if (sub->ctx) 595 Parrot_gc_mark_PObj_alive(interp, (PObj *) sub->ctx); 596 if (sub->outer_ctx) 597 Parrot_gc_mark_PObj_alive(interp, (PObj *) sub->outer_ctx); 574 Parrot_gc_mark_STRING_alive(INTERP, sub->name); 575 Parrot_gc_mark_STRING_alive(INTERP, sub->method_name); 576 Parrot_gc_mark_STRING_alive(INTERP, sub->ns_entry_name); 577 Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_name); 578 Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_stash); 579 Parrot_gc_mark_PMC_alive(INTERP, sub->multi_signature); 580 Parrot_gc_mark_PMC_alive(INTERP, sub->lex_info); 581 Parrot_gc_mark_PMC_alive(INTERP, sub->outer_sub); 582 Parrot_gc_mark_PMC_alive(INTERP, sub->eval_pmc); 583 Parrot_gc_mark_STRING_alive(INTERP, sub->subid); 584 Parrot_gc_mark_PMC_alive(interp, sub->ctx); 585 Parrot_gc_mark_PMC_alive(interp, sub->outer_ctx); 598 586 } 599 587 600 588 /* -
src/pmc/callsignature.pmc
179 179 Parrot_CallSignature_attributes * const attrs = PARROT_CALLSIGNATURE(SELF); 180 180 181 181 if (attrs) { 182 if (attrs->returns) 183 Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->returns); 184 if (attrs->type_tuple) 185 Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->type_tuple); 186 if (attrs->short_sig) 187 Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->short_sig); 182 Parrot_gc_mark_PMC_alive(interp, attrs->returns); 183 Parrot_gc_mark_PMC_alive(interp, attrs->type_tuple); 184 Parrot_gc_mark_STRING_alive(interp, attrs->short_sig); 188 185 } 189 186 SUPER(); 190 187 } -
src/gc/api.c
236 236 237 237 /* 238 238 239 =item C<void Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, PMC *obj)> 240 241 A type safe wrapper of Parrot_gc_mark_PObj_alive for PMC. 242 243 =cut 244 245 */ 246 247 PARROT_EXPORT 248 void 249 Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(PMC *obj)) 250 { 251 ASSERT_ARGS(Parrot_gc_mark_PMC_alive_fun) 252 if (!PMC_IS_NULL(obj)) { 253 PARROT_ASSERT(PObj_is_PMC_TEST(obj)); 254 Parrot_gc_mark_PObj_alive(interp, (PObj *)obj); 255 } 256 } 257 258 /* 259 260 =item C<void Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP, STRING *obj)> 261 262 A type safe wrapper of Parrot_gc_mark_PObj_alive for STRING. 263 264 =cut 265 266 */ 267 268 PARROT_EXPORT 269 void 270 Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(STRING *obj)) 271 { 272 ASSERT_ARGS(Parrot_gc_mark_STRING_alive_fun) 273 if (!STRING_IS_NULL(obj)) { 274 PARROT_ASSERT(PObj_is_string_TEST(obj)); 275 Parrot_gc_mark_PObj_alive(interp, (PObj *)obj); 276 } 277 } 278 279 /* 280 239 281 =item C<void Parrot_gc_initialize(PARROT_INTERP, void *stacktop)> 240 282 241 283 Initializes the memory allocator and the garbage collection subsystem. -
include/parrot/gc_api.h
112 112 __attribute__nonnull__(1); 113 113 114 114 PARROT_EXPORT 115 void Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(PMC *obj)) 116 __attribute__nonnull__(1) 117 FUNC_MODIFIES(*obj); 118 119 PARROT_EXPORT 115 120 void Parrot_gc_mark_PObj_alive(PARROT_INTERP, ARGMOD(PObj *obj)) 116 121 __attribute__nonnull__(1) 117 122 __attribute__nonnull__(2) 118 123 FUNC_MODIFIES(*obj); 119 124 120 125 PARROT_EXPORT 126 void Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP, 127 ARGMOD_NULLOK(STRING *obj)) 128 __attribute__nonnull__(1) 129 FUNC_MODIFIES(*obj); 130 131 PARROT_EXPORT 121 132 unsigned int Parrot_is_blocked_GC_mark(PARROT_INTERP) 122 133 __attribute__nonnull__(1); 123 134 … … 315 326 PARROT_ASSERT_ARG(interp) 316 327 #define ASSERT_ARGS_Parrot_block_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 317 328 PARROT_ASSERT_ARG(interp) 329 #define ASSERT_ARGS_Parrot_gc_mark_PMC_alive_fun __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 330 PARROT_ASSERT_ARG(interp) 318 331 #define ASSERT_ARGS_Parrot_gc_mark_PObj_alive __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 319 332 PARROT_ASSERT_ARG(interp) \ 320 333 && PARROT_ASSERT_ARG(obj) 334 #define ASSERT_ARGS_Parrot_gc_mark_STRING_alive_fun \ 335 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 336 PARROT_ASSERT_ARG(interp) 321 337 #define ASSERT_ARGS_Parrot_is_blocked_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 322 338 PARROT_ASSERT_ARG(interp) 323 339 #define ASSERT_ARGS_Parrot_is_blocked_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \ … … 448 464 449 465 void Parrot_gc_inf_init(PARROT_INTERP); 450 466 467 #ifdef NDEBUG 468 # define Parrot_gc_mark_PMC_alive(interp, obj) \ 469 do if (! PMC_IS_NULL(obj)) Parrot_gc_mark_PObj_alive((interp), (PObj *)(obj)); while (0) 470 # define Parrot_gc_mark_STRING_alive(interp, obj) \ 471 do if (! STRING_IS_NULL(obj)) Parrot_gc_mark_PObj_alive((interp), (PObj *)(obj)); while (0) 472 #else 473 # define Parrot_gc_mark_PMC_alive(interp, obj) Parrot_gc_mark_PMC_alive_fun((interp), (obj)) 474 # define Parrot_gc_mark_STRING_alive(interp, obj) Parrot_gc_mark_STRING_alive_fun((interp), (obj)) 475 #endif 476 451 477 #endif /* PARROT_GC_API_H_GUARD */ 452 478 453 479 /*