------- Comment #3 from fxcoudert at gcc dot gnu dot org 2010-06-09 12:07
-------
Hey, I actually have the answer to this one: yes, it is intended as is, and
not, it is a bit more complicated that Jerry says.
We maintain a hash table of identifiers, so that when we have multiple times
the same string, it's always allocated only once. See how gfc_get_string works,
especially the comment at the top:
/* Given printf-like arguments, return a stable version of the result string.
We already have a working, optimized string hashing table in the form of
the identifier table. Reusing this table is likely not to be wasted,
since if the function name makes it to the gimple output of the frontend,
we'll have to create the identifier anyway. */
The other, extra-nice benefits of these are 1. we do not have to compare
strings, but simply pointers; 2. we don't have to worry about releasing memory
on a per-case basis.
As such, I'm closing this PR. If you think the analysis is incorrect, please
reopen.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43710