lib/hmap.c
/* Expands 'hmap', if necessary, to optimize the performance of searches when
 * it has up to 'n' elements.  (But iteration will be slow in a hash map whose
 * allocated capacity is much higher than its current number of nodes.)
 *
 * ('where' is used in debug logging.  Commonly one would use hmap_reserve() to
 * automatically provide the caller's source file and line number for
 * 'where'.) */
Expands 'hmap', if necessary, to optimize the performance of searches when
it has up to 'n' elements.  (But iteration will be slow in a hash map whose
allocated capacity is much higher than its current number of nodes.)

('where' is used in debug logging.  Commonly one would use hmap_reserve() to
automatically provide the caller's source file and line number for
'where'.)
Expands ' hmap ' if necessary to optimize the performance of searches when it has up to ' n ' elements . ( But iteration will be slow in a hash map whose allocated capacity is much higher than its current number of nodes . ) ( ' where ' is used in debug logging . Commonly one would use hmap_reserve () to automatically provide the caller ' s source file and line number for ' where ' . )
void
hmap_reserve_at(struct hmap *hmap, size_t n, const char *where)
{
    size_t new_mask = calc_mask(n);
    if (new_mask > hmap->mask) {
        COVERAGE_INC(hmap_reserve);
        resize(hmap, new_mask, where);
    }
}
void hmap_reserve_at ( struct hmap * hmap , size_t n , const char * where ) { size_t new_mask = calc_mask ( n ) ; if ( new_mask > hmap -> mask ) { COVERAGE_INC ( hmap_reserve ) ; resize ( hmap , new_mask , where ) ; } }
Expands 'hmap', if necessary, to optimize the performance of searches when
 it has up to 'n' elements.
Expands ' hmap ' if necessary to optimize the performance of searches when it has up to ' n ' elements .