3 ms·
I always use this technique. It make no sense to free() all the memory just before the exit(). But the prerequisite isn't whether the program is short-lived,
by teo_zero 4y ago
I always use this technique. It make no sense to free() all the memory just before the exit().
But the prerequisite isn't whether the program is short-lived, but rather that the memory usage pattern is "alloc often, free at the end".
- simonkagedal 4y agoWith ”short-lived”, I rather meant something like: ”does one job and then exits”, as opposed to something more dynamic – of course, that it takes a long or short time to execute isn’t by itself relevant.