* Merged with default branch at rev 16f3633aaa5a.
[cacao.git] / src / vmcore / class.c
index 51ddc07bb38667c4ebf0ac5e40cc0a8110baea98..5c810efa571a4f13a4b34da39c5573f70ccb7d2a 100644 (file)
@@ -219,8 +219,12 @@ classinfo *class_create_classinfo(utf *classname)
 
        /* GCNEW_UNCOLLECTABLE clears the allocated memory */
 
+#if defined(ENABLE_GC_CACAO)
+       c = (classinfo *) heap_alloc_uncollectable(sizeof(classinfo));
+#else
        c = GCNEW_UNCOLLECTABLE(classinfo, 1);
        /*c=NEW(classinfo);*/
+#endif
        c->name = classname;
 
        /* Set the header.vftbl of all loaded classes to the one of
@@ -843,6 +847,16 @@ void class_free(classinfo *c)
                mem_free(c->header.vftbl, sizeof(vftbl) + sizeof(methodptr)*(c->vftbl->vftbllength-1)); */
        
 /*     GCFREE(c); */
+
+#if defined(ENABLE_ANNOTATIONS)
+       annotation_bytearray_free(c->annotations);
+
+       annotation_bytearrays_free(c->method_annotations);
+       annotation_bytearrays_free(c->method_parameterannotations);
+       annotation_bytearrays_free(c->method_annotationdefaults);
+
+       annotation_bytearrays_free(c->field_annotations);
+#endif
 }