allows for easy memory allocation tracking and also avoids including
<stdlib.h> at random places.
bzero(x, size);
return x;
}
+
+void
+xfree(void *ptr)
+{
+ /*
+ * Maybe it is a little waste of resources to make this a function instead
+ * of a macro, but xmalloc() is not used for anything critical anyway,
+ * so let's prefer simplicity.
+ */
+ free(ptr);
+}
/*
* The UCW Library -- Miscellaneous Functions
*
- * (c) 1997--2005 Martin Mares <mj@ucw.cz>
+ * (c) 1997--2006 Martin Mares <mj@ucw.cz>
* (c) 2005 Tomas Valla <tom@ucw.cz>
*
* This software may be freely distributed and used according to the terms
*/
void *xmalloc(unsigned);
void *xrealloc(void *, unsigned);
-#define sh_xfree(x) free(x)
+void xfree(void *);
#endif
void *xmalloc_zero(unsigned);