logoalt Hacker News

byroottoday at 7:02 AM1 replyview on HN

That's why C23 introduce free_sized [0].

[0] https://en.cppreference.com/c/memory/free_sized


Replies

Someonetoday at 9:28 AM

>> If you can convince the caller to keep track of that metadata themselves you obviously don’t need to. That can be important.

> That's why C23 introduce free_sized

Is it? C23 still has free, so there’s no guarantee callers wil use free_sized, so the allocator still has to be able to obtain a block’s size from a pointer.

Or do I overlook something?

show 1 reply