Re: [PATCH] Fix memory leak in C++ pretty printer

2015-05-20 Thread Jason Merrill
On 05/11/2015 02:01 PM, Jason Merrill wrote: On 05/11/2015 12:57 PM, Jason Merrill wrote: On 05/11/2015 08:03 AM, Manuel López-Ibáñez wrote: My preference would be to replace the static with a pointer and placement-new with proper new and delete Actually, on second thought, there really doesn

Re: [PATCH] Fix memory leak in C++ pretty printer

2015-05-11 Thread Jason Merrill
On 05/11/2015 12:57 PM, Jason Merrill wrote: On 05/11/2015 08:03 AM, Manuel López-Ibáñez wrote: My preference would be to replace the static with a pointer and placement-new with proper new and delete Actually, on second thought, there really doesn't seem to be a need for that. The patch sho

Re: [PATCH] Fix memory leak in C++ pretty printer

2015-05-11 Thread Jason Merrill
On 05/11/2015 08:03 AM, Manuel López-Ibáñez wrote: My preference would be to replace the static with a pointer and placement-new with proper new and delete, but see: https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00910.html Agreed. Jason

Re: [PATCH] Fix memory leak in C++ pretty printer

2015-05-11 Thread Manuel López-Ibáñez
On 11/05/15 03:34, Patrick Palka wrote: In gcc/cp/error.c we initialize the C++ pretty printer object twice: first during statics initialization and later in a placement-new in init_error(). This double-initialization causes a memory leak of about 7kb according to valgrind. I don't see a reason

Re: [PATCH] Fix memory leak in C++ pretty printer

2015-05-11 Thread Manuel López-Ibáñez
On 11/05/15 03:34, Patrick Palka wrote: In gcc/cp/error.c we initialize the C++ pretty printer object twice: first during statics initialization and later in a placement-new in init_error(). This double-initialization causes a memory leak of about 7kb according to valgrind. I don't see a reason

[PATCH] Fix memory leak in C++ pretty printer

2015-05-10 Thread Patrick Palka
In gcc/cp/error.c we initialize the C++ pretty printer object twice: first during statics initialization and later in a placement-new in init_error(). This double-initialization causes a memory leak of about 7kb according to valgrind. I don't see a reason to initialize the object a second time so