Quote:
Originally Posted by DMWCashy
If all the objects are the same size, you could use an arena memory pool
|
Alas, each item is of arbitrary size. I'm combining various text files together and each item represents a line from a file. Using a linked list felt like a reasonable approach, since I can easily move around and insert and remove lines at specific positions. However, the same end result can certainly be obtained without the list.
Quote:
This also uses less memory, as each malloc has a header block of 8 bytes
|
Thanks, I didn't know that!