* Align hashtable entries correctly so that Python modules don't crash!

This commit is contained in:
trisk
2007-07-15 01:42:22 +00:00
parent 6a1aa7b881
commit 5f533850e0
+2 -2
View File
@@ -223,7 +223,7 @@ BongoHashtableCreateFull(int buckets,
DeleteFunction keydeletefunc, DeleteFunction valuedeletefunc)
{
BongoHashtable *table;
const int size = sizeof(BongoHashtable) + buckets * sizeof(struct BongoHashtableEntry *);
const int size = ALIGN_SIZE(sizeof(BongoHashtable), ALIGNMENT) + buckets * ALIGN_SIZE(sizeof(struct BongoHashtableEntry *), ALIGNMENT);
table = MemMalloc(size);
if (!table) {
@@ -237,7 +237,7 @@ BongoHashtableCreateFull(int buckets,
table->keydeletefunc = keydeletefunc;
table->valuedeletefunc = valuedeletefunc;
memset(&(table->buckets[0]), 0, buckets * sizeof(struct BongoHashtableEntry *));
//memset(&(table->buckets[0]), 0, buckets * ALIGN_SIZE(sizeof(struct BongoHashtableEntry *), ALIGNMENT));
return table;
}