[Development] Qt's Leak-on-exit policy

Kuba Ober kuba at mareimbrium.org
Sat Dec 21 00:39:53 CET 2013

On Dec 18, 2013, at 7:17 PM, Andreas Hartmetz <ahartmetz at gmail.com> wrote:

> 2) reminds me of a crazy idea I've had once... freeing memory (not
> object destruction!) at application exit really serves no other purpose
> than making leak checkers happy. Not saying that this isn't an
> important goal, btw. So shutdown could be accelerated by putting
> free() into a special shutdown mode that just immediately returns.
> Of course there would be a conditional branch somewhere, unless you
> modified the GOT entry for free() or something. That would add a
> runtime overhead, which is worse than slightly slower shutdown.

It would warrant some investigation how the time spent in `free()`
or `operator delete` compares to the time spent in the destructors proper.
The memory allocator is probably optimized there and back again. Destructors
- probably not very much, unless they are in short-lifetime, oft-destructed

Cheers, Kuba

More information about the Development mailing list