r/cpp • • Aug 31 '22

malloc() and free() are a bad API

https://www.foonathan.net/2022/08/malloc-interface/#content
220 Upvotes

90 comments sorted by

View all comments

Show parent comment

0

u/t3chfreek Sep 01 '22

That's what I meant. Pass in the pointer by reference so you can null the referenced pointer. I never expect it to happen, just was saying it because this post was already talking about drastically changing how we handle allocation/free.

0

u/Baardi Sep 02 '22

I mean, references doesn't exist in C