[Gc] Mark with offset

Niklas Therning niklas at therning.org
Sun Mar 31 04:48:49 PST 2013


In RoboVM we're representing Java Object arrays of length n like this:

  Class* arrayClass;
  Monitor lock;
  int32_t length;
  Object* values[n];

We would like the GC to scan structures like this precisely which means
that only the values should be scanned. Is there anyway we can tell the GC
to skip the first 3 fields? There doesn't seem to be a way to express this
using the descriptors in gc_mark.h?

We've tried to use a custom mark proc but quickly ran into mark stack
overflows for large arrays. Maybe there's a better way than to just
call GC_MARK_AND_PUSH() for each value in the array from the custom mark
proc? Maybe GC_push_all() can be used somehow?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://napali.hpl.hp.com/pipermail/gc/attachments/20130331/d5d481d0/attachment.htm

More information about the Gc mailing list