* support/Util/NewAlloc.c (freeTrace): Changed free for the gc case to not free...
[fw/sdcc] / src / SDCChasht.c
index 71821860912bff87a50720c5a815399850190a96..cc467afd7f928a19b799849e75d82e67c1feb816 100644 (file)
@@ -40,7 +40,7 @@ _newHashtItem (int key, void *pkey, void *item)
 {
   hashtItem *htip;
 
-  htip = Safe_calloc (1, sizeof (hashtItem));
+  htip = Safe_alloc ( sizeof (hashtItem));
 
   htip->key = key;
   htip->pkey = pkey;
@@ -57,9 +57,9 @@ newHashTable (int size)
 {
   hTab *htab;
 
-  htab = Safe_calloc (1, sizeof (hTab));
+  htab = Safe_alloc ( sizeof (hTab));
 
-  if (!(htab->table = calloc ((size + 1), sizeof (hashtItem *))))
+  if (!(htab->table = Safe_alloc ((size + 1) * sizeof (hashtItem *))))
     {
       fprintf (stderr, "out of virtual memory %s %d\n",
               __FILE__, (size + 1) * sizeof (hashtItem *));
@@ -193,13 +193,13 @@ hTabDeleteAll (hTab * p)
          jn = jc->next;
          while (jc)
            {
-             free (jc);
+             Safe_free (jc);
              if ((jc = jn))
                jn = jc->next;
            }
          p->table[i] = NULL;
        }
-      free (p->table);
+      Safe_free (p->table);
     }
 }
 
@@ -557,7 +557,7 @@ shash_add (hTab ** h, const char *szKey, const char *szValue)
   /* First, delete any that currently exist */
   hTabDeleteByKey (h, key, szKey, _compare);
   /* Now add in ours */
-  hTabAddItemLong (h, key, gc_strdup (szKey), gc_strdup (szValue));
+  hTabAddItemLong (h, key, Safe_strdup (szKey), Safe_strdup (szValue));
 }
 
 const char *