Ignore:
Timestamp:
Oct 3, 2006 5:13:22 PM (18 years ago)
Author:
bennylp
Message:

Fixed bug in the hash table size calculation. The hash table creation API (pj_hash_create()) suggests that the size should be 2n-1, and when the size is not 2n-1, it will be rounded-up to the nearest 2n-1, except when the size is exactly 2n, then it will be rounded-down to 2n-1.

The bug caused the hash table size to be doubled when application gives 2n size (instead of rounding it down to 2n-1).

Nothing dangerous happened because of the bug, it just caused hash table size to be doubled the requirement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/hash.c

    r623 r748  
    116116    do { 
    117117        table_size <<= 1;     
    118     } while (table_size <= size); 
     118    } while (table_size < size); 
    119119    table_size -= 1; 
    120120     
Note: See TracChangeset for help on using the changeset viewer.