[PATCH 08/15] hash.h: rearrange xcalloc arguments
- From
Brian Gesiak <modocache@gmail.com>
- Date
- May 26, 2014, 15:33 UTC
- Message-ID
- <1401118436-66090-9-git-send-email-modocache@gmail.com>
- In-Reply-To
- <1401118436-66090-1-git-send-email-modocache@gmail.com>
xcalloc takes two arguments: the number of elements and their size. prellocate_hash passes the arguments in reverse order, passing the size of a hash table entry, followed by the number of entries. Rearrgange them so they are in the correct order.
Signed-off-by: Brian Gesiak <modocache@gmail.com> --- hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hash.h b/hash.h index 1d43ac0..3b5d9e7 100644 --- a/hash.h +++ b/hash.h @@ -44,7 +44,7 @@ static inline void preallocate_hash(struct hash_table *table, unsigned int elts) { assert(table->size == 0 && table->nr == 0 && table->array == NULL); table->size = elts * 2; - table->array = xcalloc(sizeof(struct hash_table_entry), table->size); + table->array = xcalloc(table->size, sizeof(struct hash_table_entry)); } #endif
-- 2.0.0.rc1.543.gc8042da