logoalt Hacker News

ueckeryesterday at 3:13 PM1 replyview on HN

A modern compiler may also completely remove malloc / free pairs and move the computation to the stack. And I do not see what this has to do with C, it should be the same for most languages. C gives you tools to express low-level intent such as "volatile", but one has to use them.


Replies

112233today at 6:44 AM

Strong disagree. In C, malloc and free are functions, and I expect no magic to happen when calling a function. If malloc and free were keywords like sizeof, it would have been different.

show 2 replies