4 ms·
I can't recall the last time I used malloc/free in C++. Even new/delete are rare acquaintances, I use new most often in unit tests. As far as I'm concerned, it
by Xorlev 4y ago
I can't recall the last time I used malloc/free in C++. Even new/delete are rare acquaintances, I use new most often in unit tests.
As far as I'm concerned, it's automatic memory management (with lots of control). There's also the other end of the automatic memory management spectrum, garbage collection.
- pjmlp 4y agoIt is incredible how even something basic like new, which most C predecessors already had, isn't never going to be part of it, manually calculating heap allocations for 50 years.
- jstimpfle 4y agoMaybe you haven't caught up with C best practices. I like C programming and I rarely do malloc()/free().
- pjmlp 4y agoI have, oh boy do I have, on those code bases where we do pentesting or apply SecDevOps security assessment tooling. CVE database is updated almost every week on those "best" practices.
- jstimpfle 4y agoIn other words, you're saying that good practices aren't followed widely even though better practices might be available in some of the situations you are seeing? Which would be a fair point, I only don't like the way you walk around what I said.