]> code.delx.au - pulseaudio/commitdiff
* make pa_xfree() a real function
authorLennart Poettering <lennart@poettering.net>
Wed, 17 May 2006 19:07:30 +0000 (19:07 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 May 2006 19:07:30 +0000 (19:07 +0000)
* update doxygen docs for xmalloc.h

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@913 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/polyp/xmalloc.c
src/polyp/xmalloc.h

index 4c8689a6c5708cee60005951f856fdcb43420e3d..1deeebd80d7c598390736b88a6f5299a72495680 100644 (file)
@@ -121,3 +121,9 @@ char *pa_xstrndup(const char *s, size_t l) {
     }
 }
 
+void pa_xfree(void *p) {
+    if (!p)
+        return;
+
+    free(p);
+}
index 2946011aff1490ae05829f0e9a01210729a84ad5..9d91d8dc48e50d8f087882103f2504d97e1c0f85 100644 (file)
 #include <limits.h>
 #include <assert.h>
 
+/** \file
+ * Memory allocation functions.
+ */
+
+/** Allocate the specified number of bytes, just like malloc() does. However, in case of OOM, terminate */
 void* pa_xmalloc(size_t l);
+
+/** Same as pa_xmalloc(), but initialize allocated memory to 0 */
 void *pa_xmalloc0(size_t l);
+
+/**  The combination of pa_xmalloc() and realloc() */
 void *pa_xrealloc(void *ptr, size_t size);
-#define pa_xfree free
 
+/** Free allocated memory */
+void pa_xfree(void *p);
+
+/** Duplicate the specified string, allocating memory with pa_xmalloc() */
 char *pa_xstrdup(const char *s);
+
+/** Duplicate the specified string, but truncate after l characters */
 char *pa_xstrndup(const char *s, size_t l);
 
+/** Duplicate the specified memory block */
 void* pa_xmemdup(const void *p, size_t l);
 
 /** Internal helper for pa_xnew() */