Oh! I'm sorry. I made mistakes. I misunderstood the code. Now I made clear.
---------- Forwarded message ---------- From: 周毅敏 <[email protected]> Date: 2009/12/11 Subject: Re: [android-porting] Re: xor algorithm used when gc in dalvik To: In dalvik\vm\alloc\marksweep.c's function: dvmHeapSweepUnmarkedObjects(int *numFreed, size_t *sizeFreed) { ... * dvmHeapBitmapXorWalkLists(markBitmaps, objectBitmaps, numBitmaps,sweepBitmapCallback, NULL);* ... } 2009/12/11 fadden <[email protected]> What bit of code are you looking at? > > On Dec 10, 12:35 am, bazookier <[email protected]> wrote: > > The gc in dalvik is not very difficult. > > I can understand most things and how they work. > > But one thing I don't understand. > > When freeing the memory allocated by mspace which is set int the bits > > of heap bitmap, it uses xor operating to calculate what should be > > collected. > > Suppose like this: > > After last gc after this gc result should be > > collected > > 0 0 0 N > > 1 1 0 N > > 1 0 1 Y > > 0 1 1 Y(Is > > this right?) > > > > The first three cases are obviously correct. > > But the last case perhaps is wrong. > > Although it was not used before last gc, it is used since then. > > It should not be collected as garbage I think. > > Can anyone explain why? > > -- > unsubscribe: > [email protected]<android-porting%[email protected]> > website: http://groups.google.com/group/android-porting -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
