Re: [Algorithms] memory pool algorithms
Brought to you by:
vexxed72
|
From: Jon W. <jw...@gm...> - 2009-04-23 17:52:30
|
Why can't you use both an index and a list? Would the overhead be prohibitive? Sincerely, jw Pau...@sc... wrote: > I was just wondering if anyone knew of an algorithm/method which > facilitated simple memory pool allocation of a single type but with > constant time allocation/deallocation/item retrieval by index and also > provided a 'nice' way to iterate through the used elements? > > We have a class which gives us everything but the last two together. We > can add a linked list of used elements (giving us the iteration) but then > you can't retrieve by index in constant time. Or we can retrieve by index > in constant time but then you can't iterate cleanly because there will be > holes in the memory pool. > > |