C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Deliberate memory leak

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sun, 13 Oct 2024 21:06:06 +0100
On Sat, Oct 12, 2024 at 6:27 PM Tiago Freire wrote:
>
> FYI. He's a known troll.
>
> Please don't waste your time.
> If you needed any clue. You have been able to memory
> leak since ever, you don't need a standard support for that,
> people generally want to do the opposite. The idea itself is idiotic.


I don't know how you discovered that I attended a cosplay event
dressed as a troll but nonetheless I am grateful for the flattery. I
actually asked them to paint me as a male-presenting version of
Mystique from X-Men but I ended up looking like a troll so I just
embraced it. You still haven't even told me your favourite flower --
this isn't a level playing field by any means as you already know that
mine's the tulip.

I agree that we don't need support from the C++ standard library to
leak memory (or any resource). When developing a program, and testing
it as we go along, it's useful to use tools like valgrind to see if
we're leaking resources anywhere. Time and effort can be wasted
chasing memory resource leaks that aren't really leaks -- i.e. the
resource is acquired once for the entire program and doesn't need to
be released until the death of the process. I wasted lots of time on
fonts that weren't deallocated by either libpango or libfontconfig.

Having a standard library function such as "std::deliberate_leak"
would serve too functions:
    (1) Stop us wasting time chasing leaks that are benign
    (2) To reduce the clutter in the output from the debugger programs

Received on 2024-10-13 20:06:14