Relative Content

Tag Archive for c++memorymemory-managementmemory-leakslinked-list

Linked list entity system breaks unexpectedly

I am building an entity system for a video game using doubly linked lists. The nodes (entity) of the linked list is allocated in a special manner; when allocating, a free-list is first searched to see if there exists previously deallocated entities. If an entity exists, it is popped off from the free list and then pushed back into the active entity list with original order maintained. If no such entity exists on the free list, a new entity is allocated from the arena.