This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 02/16] gcc: Embed the driver in-process within libgccjit
- From: Bert Wesarg <bert dot wesarg at googlemail dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Date: Wed, 3 Jun 2015 08:00:15 +0200
- Subject: Re: [PATCH 02/16] gcc: Embed the driver in-process within libgccjit
- Authentication-results: sourceware.org; auth=none
- References: <1433192664-50156-1-git-send-email-dmalcolm at redhat dot com> <1433192664-50156-3-git-send-email-dmalcolm at redhat dot com>
On Mon, Jun 1, 2015 at 11:04 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> Provide a way to clean up state within the driver code, and use this
> from libgccjit to embed it in-process, rather that via pex. Part of
> this requires restoring the environment after any putenv calls, so the
> patch introduces an env_manager class. No effort is made to restore
> the environment for the classic use-case.
>
> This embedding gives a slight performance win for
> jit.dg/test-benchmark.c, and enables bigger performance gains in
> followup patches.
>
> I've fixed the worst of the memory leaks, but this does still
> leak somewhat.
>
> gcc/ChangeLog:
> * gcc-main.c (main): Add params to driver ctor.
> * gcc.c (class env_manager): New.
> (env): New global.
> (env_manager::init): New.
> (env_manager::getenv): New.
> (env_manager::xputenv): New.
> (env_manager::restore): New.
> Poison genenv and putenv.
getenv? The same applies to the actual #pragma statement.
Bert