Re: [Algorithms] memory pool algorithms
Brought to you by:
vexxed72
|
From: Alen L. <ale...@cr...> - 2009-04-23 19:38:38
|
Thursday, April 23, 2009, 6:32:35 PM, Mat wrote: > Is the memory pool contiguous? If not, then it's kind of > scary/impossible to have indexable access, but who knows? Unless you keep a separate index table which can be contiguous. If the objects are large and/or you cannot afford to move them around, because someone has pointers to them, it is useful to allocate the objects any way you fancy, and then keep a contiguous table of index-to-pointer mappings in the ways previously described. If you are doing random deletion, you will need to store pointer-to-index mapping together with the object in that case. Alen |