3 ms·
Valgrind's leak detector separately reports: - still reachable allocated blocks - possibly leaked blocks: block reachable only via pointers to their interior
by kazinator 11y ago
Valgrind's leak detector separately reports:
- still reachable allocated blocks
- possibly leaked blocks: block reachable only via pointers
to their interior, not to their base address
- definitely leaked blocks: blocks not reachable by any pointer in the program image.
Even the simplest tools like dmalloc do not report all allocations ever performed as leaks (even ones that have been freed). The simple tools report the still-in-use blocks, regardless of whether they are reachable or not.
That can be "good enough". And anyway, sometimes blocks that are still reachable are de facto leaks. Programs can have "semantic leaks" whereby some dynamic set data structure keeps growing and growing as processing marches on. For instance, a global hash table from which nothing is removed even though the entries have ceased to be relevant and the table is the only thing which refers to them. (Someone forgot to make the hash table a weak hash).