Hacker News new | past | comments | ask | show | jobs | submit login

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".




With ”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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: