On Thu, Sep 12, 2019, 7:24 PM Simon Burge <sim...@netbsd.org> wrote: > Kamil Rytarowski wrote: > > > I will revert it, but I am looking for a more generic approach. > > > > How about adding ifdef __NO_LEAKS like: > > > > #ifdef __NO_LEAKS > > free(3)? > > #endif > > > > And in lsan/asan/valgrind/etc checks use -D__NO_LEAKS. > > Sorry if I'm missing something that has been already explained, > but why (practically) do we care about memory leaks for a utility > that is about to finish? > > If we're doing some ugly #ifdef dance only when running the > sanitiser(s), then we haven't actually done anything to "fix" > the leak in the installed binaries so it seems that there was > no practical problem that we were trying to solve in the first > place. >
When multiple people are doing leak busting, maybe over years, they eliminate many false positives so you can focus on the real issues w/o a run time penalty. Especially something in the library that comes up often... otherwise they get in the way of making progress... Warner Cheers, > Simon. >