Re: [RFD PATCH 0/3] Free all the memory!
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 17, 2016, 03:41 UTC
- Message-ID
- <CAPig+cT9UKEcNXvsQsFDrQycKwMJR5bCter76UL-zpkncniPBw@mail.gmail.com>
- In-Reply-To
- <20160517032247.25092-1-sbeller@google.com>
On Mon, May 16, 2016 at 11:22 PM, Stefan Beller <sbeller@google.com> wrote:
Show 7 quoted lines
> When using automated tools to find memory leaks, it is hard to distinguish > between actual leaks and intentional non-cleanups at the end of the program, > such that the actual leaks hide in the noise. > > The end goal of this (unfinished) series is to close all intentional memory > leaks when enabling the -DFREE_ALL_MEMORY switch. This is just > demonstrating how the beginning of such a series could look like.
Considering the signal-to-noise ratio mentioned above, the goal seems reasonable, but why pollute the code with #ifdef's all over the place by making the cleanup conditional? If you're going though the effort of plugging all these leaks, it probably makes sense to do them unconditionally.