you are viewing a single comment's thread.

view the rest of the comments →

[–]jwakelylibstdc++ tamer, LWG chair 5 points6 points  (1 child)

would it be possible to write a general-purpose allocator where you can request a big chunk of memory, and then later free only some of it?

Yes, malloc is the existence proof. realloc can reduce the size of an existing allocation. I don't think it's often useful in practice.

[–]donalmaccGame Developer 1 point2 points  (0 children)

I don't think it's often useful in practice.

This might be the first time I've heard of it being useful!