/* Memory free. */ void zfree (int type, void *ptr) { #ifdef BRCM_RIP_DEBUG alloc_dec (type); #endif free (ptr); }
/* * 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); } }
/* 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); }
/* * 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); }