[Scummvm-devel] Common::HashMap tuning

Max Horn max at quendi.de
Sun Aug 31 17:28:12 CEST 2008


Hi folks,

AFAIK, all concerns regarding this patch have been addressed in  
revision 5 (at least all that I am aware of). See <https://sourceforge.net/tracker/index.php?func=detail&aid=2062263&group_id=37116&atid=418822 
 >. In particular:
* the memory pool grows exponentially
* reduced default in-situ storage of the memory pool to 2/3 * 16 = 10,  
so the overhead is now:
   sizeof(Common::HashMap<int, int>) = 124
   sizeof(Common::StringMap) = 880
* If it turns out that this is too much, porters can easily tweak and  
lower this; you have to change this line in hashmap.h:
	FixedSizeMemoryPool<sizeof(Node), HASHMAP_MEMORYPOOL_SIZE> _nodePool;
to e.g.
	FixedSizeMemoryPool<sizeof(Node), 0> _nodePool;
to completely disable the in-situ storage. You'll still get all the  
other benefits of the improved MemoryPool code. But I am not sure this  
will be really needed, as I don't think we allocate that many  
StringMaps on the heap (but I maybe mistaken!)

So, if I don't hear any loud complaints, I'll check this in soon.


Cheers,
Max








More information about the Scummvm-devel mailing list