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] Why xstrdup cgraph node names for dumpfiles?


On Tue, Aug 26, 2014 at 10:52 PM, Uros Bizjak wrote:
> Hello!
>
>> I noticed most of the cgraph and IPA files use xstrdup for cgraph node
>> names when printing to dump_file. Very leaky...
>>
>> What is the reason for all those xstrdups? I couldn't think of any.
>
> Please see [1] and [2].
>
> [1] https://gcc.gnu.org/ml/gcc-patches/2012-04/msg01904.html
> [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53136


Thanks. Well, that is surprising. The cxx_printable_name_internal uses
a ring buffer for caching the names. Apparently that didn't work in
your PR.

The leaks get quite large over time, especially with a large code base
and many small functions. I noticed this when compiling a large code
base with dumping enabled and ran out of memory.

I assume you also tried increasing the ring buffer size? Oh well,
probably not very robust, and we do seem to leak a lot of strings in
general...

Ciao!
Steven


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