Several months ago I stumbled across something regarding large string buffers where the buffers were assembled as something similar to linked lists instead of large contiguous chunks of memory. I’m having trouble Googling this technique and was wondering if someone could help me out? The idea being you could rearrange large parts of the string without any extra reallocations (move entire sentences around, or whole paragraphs).
No clue what to search for.
I believe you’re looking for the keyword “rope”, possibly. Actually, I don’t know how those are implemented, I’ve never used them. But it’s the only alternative to contiguous strings that I’ve heard much about. And the use cases, as described, seem to be similar to what you are describing.
Here’s an example, in the SGI STL.