]> wimlib.net Git - wimlib/blobdiff - src/blob_table.c
inode_table: make the inode table resizable
[wimlib] / src / blob_table.c
index 5d464a979d5ed0ac2f9c71b734600746c238586f..54eca2c9f9d753514056cd082aeaae2673d47af2 100644 (file)
@@ -54,21 +54,13 @@ struct blob_table {
        size_t mask; /* capacity - 1; capacity is a power of 2  */
 };
 
-static size_t
-next_power_of_2(size_t n)
-{
-       if (n <= 1)
-               return 1;
-       return (size_t)1 << (1 + flsw(n - 1));
-}
-
 struct blob_table *
 new_blob_table(size_t capacity)
 {
        struct blob_table *table;
        struct hlist_head *array;
 
-       capacity = next_power_of_2(capacity);
+       capacity = roundup_pow_of_2(capacity);
 
        table = MALLOC(sizeof(struct blob_table));
        if (table == NULL)