Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-03-19 Thread Jeff Law via Gcc-patches
On 1/31/2022 4:42 AM, Marc Nieper-Wißkirchen wrote: Before the patch, compiling the hello world example of libgccjit with the external driver under Valgrind shows a loss of 12,611 (48 direct) bytes. After the patch, no memory leaks are reported anymore. (Memory leaks occurring when using the

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-03-11 Thread Marc Nieper-Wißkirchen
Hi Jeff and David, any news on this fix? Thanks, Marc Am Mo., 31. Jan. 2022 um 12:42 Uhr schrieb Marc Nieper-Wißkirchen : > > Attached to this email is the patch updated to the recent renaming from *.c > to *.cc. > > > Am So., 23. Jan. 2022 um 14:18 Uhr schrieb Marc Nieper-Wißkirchen > : >>

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-31 Thread Marc Nieper-Wißkirchen
a private field of the class pass_manager) and > in passes.cc. There is just one instance where a name is added to the > map in passes.cc, namely through the put method. There, the name has > been xstrdup'ed. > > The name (as a const char *) escapes the pass map in > pass_manager

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-23 Thread Marc Nieper-Wißkirchen
Am Sa., 15. Jan. 2022 um 14:56 Uhr schrieb Marc Nieper-Wißkirchen : > > Jeff, David, do you need any more input from my side? > > -- Marc > > Am Sa., 8. Jan. 2022 um 17:32 Uhr schrieb Jeff Law : > > > > > > > > On 1/6/2022 6:53 AM, David Malcolm via Gcc-patches wrote: > > > On Sun, 2021-12-19 at

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-15 Thread Marc Nieper-Wißkirchen
Jeff, David, do you need any more input from my side? -- Marc Am Sa., 8. Jan. 2022 um 17:32 Uhr schrieb Jeff Law : > > > > On 1/6/2022 6:53 AM, David Malcolm via Gcc-patches wrote: > > On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote: > >> This patch fixes a memory leak in the

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-08 Thread Jeff Law via Gcc-patches
On 1/6/2022 6:53 AM, David Malcolm via Gcc-patches wrote: On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote: This patch fixes a memory leak in the pass manager. In the existing code, the m_name_to_pass_map is allocated in pass_manager::register_pass_name, but never deallocated. 

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-08 Thread Marc Nieper-Wißkirchen
Thanks for replying so quickly! Am Do., 6. Jan. 2022 um 14:53 Uhr schrieb David Malcolm : [...] > Thanks for the patch. > > It looks correct to me, given that pass_manager::register_pass_name > does an xstrdup and puts the result in the map. > > That said: > - I'm not officially a reviewer for

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-08 Thread Marc Nieper-Wißkirchen
Am Do., 6. Jan. 2022 um 14:57 Uhr schrieb David Malcolm via Jit : > [...snip...] > > > > > > diff --git a/gcc/passes.c b/gcc/passes.c > > > index 4bea6ae5b6a..0c70ece5321 100644 > > > --- a/gcc/passes.c > > > +++ b/gcc/passes.c > > [...snip...] > > > > @@ -1943,7 +1944,7 @@

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-06 Thread David Malcolm via Gcc-patches
On Thu, 2022-01-06 at 08:53 -0500, David Malcolm wrote: > On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote: > > This patch fixes a memory leak in the pass manager. In the existing > > code, > > the m_name_to_pass_map is allocated in > > pass_manager::register_pass_name, but > >

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-06 Thread David Malcolm via Gcc-patches
On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote: > This patch fixes a memory leak in the pass manager. In the existing > code, > the m_name_to_pass_map is allocated in > pass_manager::register_pass_name, but > never deallocated.  This is fixed by adding a deletion in >

[PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2021-12-19 Thread Marc Nieper-Wißkirchen
This patch fixes a memory leak in the pass manager. In the existing code, the m_name_to_pass_map is allocated in pass_manager::register_pass_name, but never deallocated. This is fixed by adding a deletion in pass_manager::~pass_manager. Moreover the string keys in m_name_to_pass_map are all