Re: [RFC] Proposed changes in symbol-handling for Ada

Paul Hilfinger
2004-01-21T11:22:19Z

> 3) Have Ada symbols save the demangled names of symbols after being
> forced to demangle them. This could cause a memory increase if you
> for some reason have to demangle lots of names.

That sounds entirely reasonable.

> (Hmm: where would you allocate the cached name from? You can't get at
> the appropriate obstack from the symbol, can you?

Actually, the only true problem here is that the obvious way of
answering this question---adding to the language-specific union a new
entry containing an obstack* / char* union plus a flag---increases the
size of a symbol (logically it doesn't have to, but C layout and
alignment rules apparently add some padding). To avoid increasing its
size, there is the aesthetically distateful option of adding a flag
byte AFTER the language-specific field; or perhaps we could call it
a union tag. Harumph.

> Sigh. I do not
> enjoy worrying about memory management when programming in C.)

You don't? Good grief, man, what has happened to your sense of
adventure, your thirst for danger?

Paul