2 ms·
That's not a memory leak (when done at top level) because it's reachable for the entire execution of the program. Memory is only leaked if it's still allocated
by josephcsible 3y ago
That's not a memory leak (when done at top level) because it's reachable for the entire execution of the program. Memory is only leaked if it's still allocated once it's no longer reachable.
- spacechild1 3y agoMemcheck disagrees: https://developers.redhat.com/blog/2021/04/23/valgrind-memcheck-different-ways-to-lose-your-memory https://developers.redhat.com/blog/2021/04/23/valgrind-memch... Technically, this is still a memory leak, it's just considered less serious.