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: Remove pretty-print.c dependence on garbage collection


On Wed, May 26, 2010 at 1:36 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> This patch eliminates the dependency of pretty-print.c on garbage
> collection.
>
> I added that dependency, and commented on it, in
> <http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00064.html>. ?I think
> the principle of using garbage collection for identifier_to_locale is
> sound. ?The choice of where to put identifier_to_locale was based on
> garbage collection implying it could not be shared with the driver.
> Now I wish to share both intl.c and pretty-print.c with the driver,
> meaning that both plausible places for this function are places that
> go in the driver. ?Thus I replace the hardcoding of garbage collection
> with hooks that default to using xmalloc/free and that toplev.c
> changes to use garbage collection (just as it arranges for line maps
> to use garbage collection).

That makes sense.

> I don't particularly expect
> identifier_to_locale to be used in the driver, but if it is then it
> should work (and leak memory using xmalloc, but even less do I expect
> the driver to produce large numbers of diagnostics).
>
> Given this change, intl.c and intl.h are probably more logical places
> than pretty-print.c and pretty-print.h for the function and associated
> hook variable definitions, though I have no plans to move them.
>
> Bootstrapped with no regressions on x86_64-unknown-linux-gnu. ?OK to
> commit?

Yes.

-- Gaby


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