Re: [PATCH] PR jit/63854: Introduce xstrdup_for_dump

2014-12-04 Thread Jan Hubicka
> The auto_ptr<> idea sounds invasive (and made me wonder - why not go the > whole way and use std::string?) That would work for me too :) > > Here's an implementation of the xstrdup_for_dump idea. > > To recap the motivation: > > cgraph*.c and ipa-*.c use xstrdup on strings when dumping them v

[PATCH] PR jit/63854: Introduce xstrdup_for_dump

2014-12-04 Thread David Malcolm
The auto_ptr<> idea sounds invasive (and made me wonder - why not go the whole way and use std::string?) Here's an implementation of the xstrdup_for_dump idea. To recap the motivation: cgraph*.c and ipa-*.c use xstrdup on strings when dumping them via fprintf, leaking all of the duplicated buffe