On Tue, Mar 4, 2008 at 12:30 PM, Yuri Kashnikoff
<[EMAIL PROTECTED]> wrote:
> Xiao-Feng,
>
>
>
> > Yuri, simply copying gc_gen_iterate_heap() doesn't work, because the
> > heap state could be transient during collection. Especially for the
> > second insertion, it is in the middle of a transition from a minor
> > collection to a major collection, so the objects' states are not
> > consistent.
> >
> > Does your original code without mutator iteration work for you to
> > iterate live objects in MOS?
> Yes. I found the place where objects' states are consistent. And it works
> well.
> Thank you for your answers, they helped me a lot.
>
> I would like to find a place where all objects in MOS are marked as
> live/dead, but before
> compactisation. May such state be produced by playing with
> num_marking_collectors ?
> Or is there any appropriate method to produce such state (for further
> MOS iteration)?
The right place is right after GC scaning the heap.
Please try at line #216 in mark_compact/mspace_move_compact.cpp ,
shown as the arrow points below:
old_num = atomic_inc32(&num_marking_collectors);
if( ++old_num == num_active_collectors ){
/* last collector's world here */
/* prepare for next phase */
gc_init_block_for_collectors(gc, mspace);
-->
if(!IGNORE_FINREF )
collector_identify_finref(collector);
Thanks.
xiaofeng
> --
>
>
> Yuri S. Kashnikov
> Novosibirsk State University, Russia
> 2 Pirogova street
> 630090, Novosibirsk-90
> [EMAIL PROTECTED]
>
--
http://xiao-feng.blogspot.com