Branch: Tag:

2016-10-24

2016-10-24 07:59:51 by Martin Karlgren <marty@roxen.com>

map_delete: Match rehash test with new size calculation.

This avoids unnecessary rehashing that would occur on each m_delete in
a mapping having between x-(x/16)+8 and x entries, where x is any power of
2.

1186:   #endif       if (!(md->flags & MAPPING_FLAG_NO_SHRINK)) { -  if((md->size < md->hashsize * MIN_LINK_LENGTH) && +  if((MAP_SLOTS(md->size) < md->hashsize * MIN_LINK_LENGTH) &&    (md->hashsize > AVG_LINK_LENGTH)) {    debug_malloc_touch(m);    rehash(m, MAP_SLOTS(m->data->size));