isisd: add Google's changes to IS-IS
diff --git a/isisd/dict.c b/isisd/dict.c
index 6c3e1e7..35cb924 100644
--- a/isisd/dict.c
+++ b/isisd/dict.c
@@ -18,17 +18,11 @@
  * $Name$
  */
 
-#include <stdlib.h>
-#include <stddef.h>
 #include "zebra.h"
 #include "zassert.h"
-#define DICT_IMPLEMENTATION
+#include "memory.h"
 #include "dict.h"
 
-#ifdef KAZLIB_RCSID
-static const char rcsid[] = "Id: dict.c,v 1.40.2.7 2000/11/13 01:36:44 kaz";
-#endif
-
 /*
  * These macros provide short convenient names for structure members,
  * which are embellished with dict_ prefixes so that they are
@@ -246,7 +240,7 @@
 
 dict_t *dict_create(dictcount_t maxcount, dict_comp_t comp)
 {
-    dict_t *new = malloc(sizeof *new);
+    dict_t *new = XCALLOC(MTYPE_ISIS_DICT, sizeof(dict_t));
 
     if (new) {
 	new->compare = comp;
@@ -287,7 +281,7 @@
 void dict_destroy(dict_t *dict)
 {
     assert (dict_isempty(dict));
-    free(dict);
+    XFREE(MTYPE_ISIS_DICT, dict);
 }
 
 /*
@@ -310,9 +304,6 @@
 
 void dict_free(dict_t *dict)
 {
-#ifdef KAZLIB_OBSOLESCENT_DEBUG
-    assert ("call to obsolescent function dict_free()" && 0);
-#endif
     dict_free_nodes(dict);
 }
 
@@ -813,7 +804,7 @@
 
 int dict_alloc_insert(dict_t *dict, const void *key, void *data)
 {
-    dnode_t *node = dict->allocnode(dict->context);
+    dnode_t *node = dict->allocnode (dict->context);
 
     if (node) {
 	dnode_init(node, data);
@@ -949,17 +940,17 @@
 
 static dnode_t *dnode_alloc(void *context)
 {
-    return malloc(sizeof *dnode_alloc(NULL));
+    return XCALLOC(MTYPE_ISIS_DICT_NODE, sizeof(dnode_t));
 }
 
 static void dnode_free(dnode_t *node, void *context)
 {
-    free(node);
+    XFREE(MTYPE_ISIS_DICT_NODE, node);
 }
 
 dnode_t *dnode_create(void *data)
 {
-    dnode_t *new = malloc(sizeof *new);
+    dnode_t *new = XCALLOC(MTYPE_ISIS_DICT_NODE, sizeof(dnode_t));
     if (new) {
 	new->data = data;
 	new->parent = NULL;
@@ -981,7 +972,7 @@
 void dnode_destroy(dnode_t *dnode)
 {
     assert (!dnode_is_in_a_dict(dnode));
-    free(dnode);
+    XFREE(MTYPE_ISIS_DICT_NODE, dnode);
 }
 
 void *dnode_get(dnode_t *dnode)
@@ -1235,7 +1226,7 @@
 static char *dupstring(char *str)
 {
     int sz = strlen(str) + 1;
-    char *new = malloc(sz);
+    char *new = XCALLOC(MTYPE_ISIS_TMP, sz);
     if (new)
 	memcpy(new, str, sz);
     return new;
@@ -1350,7 +1341,7 @@
 	"s                      switch to non-functioning allocator\n"
 	"q                      quit";
 
-    for (i = 0; i < sizeof darray / sizeof *darray; i++)
+    for (i = 0; i < 10; i++)
 	dict_init(&darray[i], DICTCOUNT_T_MAX, comparef);
 
     for (;;) {