src/hash_map.c
// TODO: Use clp2 from Hacker's Delight 2nd edition, pg 62.
Use clp2 from Hacker's Delight 2nd edition, pg 62.
Use clp2 from Hacker ' s Delight 2nd edition pg 62 .
size_t calc_hmap_size(size_t cap)
{
    size_t pow2_cap = 1;
    size_t log2_cap = 0;
    while (cap > pow2_cap) {
        pow2_cap = pow2_cap << 1;
        log2_cap += 1;
    }
    return log2_cap;
}
size_t calc_hmap_size ( size_t cap ) { size_t pow2_cap = 1 ; size_t log2_cap = 0 ; while ( cap > pow2_cap ) { pow2_cap = pow2_cap << 1 ; log2_cap += 1 ; } return log2_cap ; }
TODO: Use clp2 from Hacker's Delight 2nd edition, pg 62.
TODO : Use clp2 from Hacker ' s Delight 2nd edition pg 62 .