News for hackers. Stuff that matters.
Re:Blazingly fast linked lists by sfink on Tuesday May 14, 2024 @02:34PM (#40358522)
Intrusive linked lists eliminate the allocation entirely. With a vector<Obj>, you have the Obj allocation and then potential vector-related reallocations. With an intrusive linked list, you only have the Obj allocation. So your code that adds/removes list entries does no additional allocation at all, it reuses a pointer or two that was allocated as part of the original Obj allocation. Often the list manipulation happens at a time when allocation failures are inconvenient or impossible to handle.

There are no comments on this comment yet.