-/* $Id: hash.c,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
+/* $Id: hash.c,v 1.3 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
-
-
#ifdef PC_HEADER
#include "all.h"
#else
#include "GL/xf86glx.h"
#endif
#include "hash.h"
+#include "macros.h"
#endif
*/
struct HashTable *NewHashTable(void)
{
- return (struct HashTable *) calloc(sizeof (struct HashTable), 1);
+ return CALLOC_STRUCT(HashTable);
}
struct HashEntry *entry = table->Table[i];
while (entry) {
struct HashEntry *next = entry->Next;
- free(entry);
+ FREE(entry);
entry = next;
}
}
- free(table);
+ FREE(table);
}
}
/* alloc and insert new table entry */
- entry = (struct HashEntry *) calloc(sizeof(struct HashEntry), 1);
+ entry = MALLOC_STRUCT(HashEntry);
entry->Key = key;
entry->Data = data;
entry->Next = table->Table[pos];
else {
table->Table[pos] = entry->Next;
}
- free(entry);
+ FREE(entry);
return;
}
prev = entry;