ir_visibility cleanup
[libfirm] / include / libfirm / adt / xmalloc.h
index 5a8c3b6..b07d0b7 100644 (file)
 
 #include "../begin.h"
 
-/* xmalloc() & friends. */
+/**
+ * @ingroup adt
+ * @defgroup xmalloc Memory Allocation
+ * @{
+ */
 
+/**
+ * Allocate @p size bytes on the heap.
+ * This is a wrapper for malloc which calls panic() in case of errors, so no
+ * error handling is required for code using it.
+ */
 FIRM_API void *xmalloc(size_t size);
+/**
+ * Chane size of a previously allocated memory block to @p size bytes.
+ * This is a wrapper for realloc which calls panic() in case of errors, so no
+ * error handling is required for code using it.
+ */
 FIRM_API void *xrealloc(void *ptr, size_t size);
+/**
+ * Allocates memory and copies string @p str into it.
+ * This is a wrapper for strdup which calls panic() in case of errors, so no
+ * error handling is required for code using it.
+ */
 FIRM_API char *xstrdup(const char *str);
-
+/**
+ * Another name for the free function
+ * @deprecated
+ */
 #define xfree(ptr)      free(ptr)
 
 /**
@@ -124,6 +146,7 @@ FIRM_API char *xstrdup(const char *str);
  */
 #define OALLOCFZ(obst, type, member, n) ((type*)memset(OALLOCF((obst), type, member, (n)), 0, offsetof(type, member) + sizeof(*((type*)0)->member) * (n)))
 
+/** @} */
 
 #include "../end.h"