Friday, 17 June 2011

Reallocate in the Standard allocator interface

Following on from my post about having a concurrent memory stack, I've reached a slight problem. The Standard allocator does not provide a way to ask you to reallocate the memory. This means that, if you were allocating off a stack, you would have to allocate, and then free- but you can't free, because it's not on the top of the stack any longer, because you just allocated off it. And then you move the contents- rather pointlessly, because they could have just stayed where they were and the memory chunk size been increased trivially.

So then. IOStreams- check. Allocator- check. Ranges- no. Is the Standard library really the pinnacle of library design?

No comments:

Post a Comment