This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][C++] Fix dump-file corruption


On 10/5/05, Paolo Bonzini <paolo.bonzini@lu.unisi.ch> wrote:
> > Fixed by moving (swapping) a cached decls name to the position it would
> > have had if it had been freshly allocated.  This ensures that we can
> > reliably print strings with at least RING_SIZE decl names in them.
>
> I think you fail if you are printing three strings, with the first one
> not in the cache, the second at the last place in the cache, and the
> third one not in the cache.  The third cxx_printable_name will expunge
> the output of the first.

It goes like (last slot is current ring_counter, at every get, place the
new string in the leftmost slot or swap this slot with the slot holding the
string already, and then rotate the thing so that the leftmost slot goes
rightmost)

            x x x s2
get s1  x x s2 s1
get s2  x x s1 s2
get s3  x s1 s2 s3

what am I missing?

> You really need LRU.

No, I don't think so.  Swapping is ensuring LRU.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]