View Single Post
Old 26 February 2021, 02:01   #5
carls
Registered User
 
Join Date: Apr 2012
Location: Cyberspace
Posts: 57
Quote:
Originally Posted by DMWCashy View Post
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!

Last edited by carls; 26 February 2021 at 02:02. Reason: Post quoted was edited
carls is offline  
 
Page generated in 0.04257 seconds with 11 queries