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

What makes you think that this approach is only useful for resource-constrained circumstances?



Yeah it's reasonable. Unfortunately if you do it, and you run tools like Coverity, it'll produces reams of complaints about how you're leaking memory :-( There was one project which was genuinely a short-lived program that never needed to free memory, but in the end I gave in and added free() statements everywhere. Otherwise we could never have got it into RHEL.


Why not just put all the free()s at the end of main() behind an #ifdef DEBUG or something?




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

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

Search: