This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libbacktrace PATCH: improve comment for backtrace_create_state
- From: Ian Lance Taylor <iant at golang dot org>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 4 Apr 2017 06:38:40 -0700
- Subject: Re: libbacktrace PATCH: improve comment for backtrace_create_state
- Authentication-results: sourceware.org; auth=none
- References: <3defaafeedc9fa6b42e61401d4c8c84e@starynkevitch.net>
On Tue, Apr 4, 2017 at 5:05 AM, <basile@starynkevitch.net> wrote:
>
> I just discovered that backtrace_create_state should be called once, that it
> is returning some heap-allocated data (which cannot be free-d, because there
> is no
> backtrace_destroy_state routine).
>
> I suggest the attached patch (against GCC trunk r246678) which just improves
> the comment describing that function.
You are adding that backtrace_create_state should be called "(probably
at startup, e.g. early in main)"? But that is not accurate. It's
perfectly reasonable to do what GCC itself does, which is call
backtrace_create_state only when it encounters an internal compiler
error (in diagnostic_action_after_output in gcc/diagnostic.c).
How about we just add backtrace_destroy_state?
Ian