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

Jeff Law jeffreyalaw@gmail.com
Sat Mar 19 17:43:54 GMT 2022



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 internal driver are mostly in
> the driver code in gcc/gcc.c and have to be fixed separately.)
>
> The patch has been tested by fully bootstrapping the compiler with the
> frontends C, C++, Fortran, LTO, ObjC, JIT and running the test suite
> under a x86_64-pc-linux-gnu host.
>
> gcc/ChangeLog:
>
> 	PR jit/63854
> 	* hash-traits.h (struct typed_const_free_remove): New.
> 	(struct free_string_hash): New.
> 	* pass_manager.h: Use free_string_hash.
> 	* passes.cc (pass_manager::register_pass_name): Use free_string_hash.
>          (pass_manager::~pass_manager): Delete allocated m_name_to_pass_map
I'd hoped David would handle this and I've been insanely busy. 
Regardless, I've pushed this to the trunk.  Thanks and sorry for the 
long delays.

jeff



More information about the Jit mailing list