Is there any โstandardโ container (STL, boost) that can represent several memory blocks as one continuous? I need to work with some data with the following conditions:
- The total data size is not known in advance (web response)
- The memory is allocated in chunks (with some external allocation function that I do not control)
- Memory deallocation is not controlled by me, so reallocation is relatively expensive
So, after getting all the data, I have a list of pieces of memory. And I need to apply some STL algorithms (search, copy, etc.) to the data in general. There is a decision to write a container for storing information about these pieces + move an iterator that is able to "jump" from one fragment to another.
But the problem seems pretty general, so I hope there is some known answer that I am missing. Thanks in advance.
source share