Ejemplo n.º 1
0
/* Memory free. */
void
zfree (int type, void *ptr)
{
#ifdef BRCM_RIP_DEBUG
  alloc_dec (type);
#endif
  free (ptr);
}
Ejemplo n.º 2
0
/*
 * Free memory allocated by z*alloc or zstrdup.
 * Requires: ptr was returned by zmalloc, zzcalloc, or zrealloc with the
 * same type.
 * Effects: The memory is freed and may no longer be referenced.
 */
void
zfree (int type, void *ptr)
{
  if (ptr != NULL)
    {
      alloc_dec (type);
      free (ptr);
    }
}
Ejemplo n.º 3
0
/* Memory free. */
void
zebra_free (int type, void *ptr)
{
    alloc_dec (type);
    if(debug_mem)
    {
        FILE *debug_fp = fopen(logfilename, "a");
        if(debug_fp)
            fprintf(debug_fp, "free memory at   : %p ,type: %s\n", ptr, typestr[type - 1]);
        fclose(debug_fp);
    }
    free (ptr);
}
Ejemplo n.º 4
0
/*
 * Free memory allocated by z*alloc or zstrdup.
 * Requires: ptr was returned by zmalloc, zcalloc, or zrealloc with the
 * same type.
 * Effects: The memory is freed and may no longer be referenced.
 */
void
zfree (int type, void *ptr)
{
  alloc_dec (type);
  free (ptr);
}