* padding at the end) is "skip_size". "desc" is the object's GC
* descriptor. The action can use the macro
* "SCAN" to scan the object.
+ *
+ * SCAN_OBJECT_NOVTABLE - desc is provided by the includer, instead of
+ * vt. Complex arrays cannot not be scanned.
*/
#ifndef SCAN_OBJECT_ACTION
#endif
{
+#ifndef SCAN_OBJECT_NOVTABLE
GCVTable *vt;
mword desc;
/* gcc should be smart enough to remove the bounds check, but it isn't:( */
desc = vt->desc;
+#endif
switch (desc & 0x7) {
case DESC_TYPE_RUN_LENGTH:
#define SCAN OBJ_RUN_LEN_FOREACH_PTR (desc, start)
SCAN_OBJECT_ACTION;
#undef SCAN
break;
- case DESC_TYPE_ARRAY:
- case DESC_TYPE_VECTOR:
-#define SCAN OBJ_VECTOR_FOREACH_PTR (vt, start)
+ case DESC_TYPE_SMALL_BITMAP:
+#define SCAN OBJ_BITMAP_FOREACH_PTR (desc, start)
#ifndef SCAN_OBJECT_NOSCAN
SCAN;
#endif
SCAN_OBJECT_ACTION;
#undef SCAN
break;
- case DESC_TYPE_SMALL_BITMAP:
-#define SCAN OBJ_BITMAP_FOREACH_PTR (desc, start)
+ case DESC_TYPE_VECTOR:
+#define SCAN OBJ_VECTOR_FOREACH_PTR (desc, start)
#ifndef SCAN_OBJECT_NOSCAN
SCAN;
#endif
#undef SCAN
break;
case DESC_TYPE_LARGE_BITMAP:
-#define SCAN OBJ_LARGE_BITMAP_FOREACH_PTR (vt,start)
+#define SCAN OBJ_LARGE_BITMAP_FOREACH_PTR (desc, start)
#ifndef SCAN_OBJECT_NOSCAN
SCAN;
#endif
break;
case DESC_TYPE_COMPLEX:
/* this is a complex object */
-#define SCAN OBJ_COMPLEX_FOREACH_PTR (vt, start)
+#define SCAN OBJ_COMPLEX_FOREACH_PTR (desc, start)
#ifndef SCAN_OBJECT_NOSCAN
SCAN;
#endif
SCAN_OBJECT_ACTION;
#undef SCAN
break;
+#ifndef SCAN_OBJECT_NOVTABLE
case DESC_TYPE_COMPLEX_ARR:
/* this is an array of complex structs */
#define SCAN OBJ_COMPLEX_ARR_FOREACH_PTR (vt, start)
SCAN_OBJECT_ACTION;
#undef SCAN
break;
+#endif
+ case DESC_TYPE_COMPLEX_PTRFREE:
+ /*Nothing to do*/
+ SCAN_OBJECT_ACTION;
+ break;
default:
g_assert_not_reached ();
}
#undef SCAN_OBJECT_NOSCAN
#undef SCAN_OBJECT_ACTION
+#undef SCAN_OBJECT_NOVTABLE