Browse Source

add comments on bitmap's define functions

Ioannis Koutras 12 years ago
parent
commit
59a056b3b9
1 changed files with 23 additions and 1 deletions
  1. 23 1
      private-include/bitmap/bitmap.h

+ 23 - 1
private-include/bitmap/bitmap.h

@@ -28,9 +28,31 @@
 #include "bitmap/bitmap_rb.h"
 
 #ifdef BITMAP_RB_ONLY
+
+/** Tries to allocate memory from a specific bitmap-organised raw block.
+ * @param raw_block The pointer of the bitmap-organised raw block.
+ * @param size      The requested size.
+ * @retval          The address of the returned memory space.
+ */
 #define dmmlib_malloc(raw_block, size) bitmap_malloc(raw_block, size)
-#define dmmlib_free(raw_block, size) bitmap_free(raw_block, size)
+
+/** Frees the memory block inside of a specific bitmap-organised raw block.
+ * @param raw_block The pointer of the bitmap-organised raw block.
+ * @param ptr       The pointer of the memory block to be freed.
+ */
+#define dmmlib_free(raw_block, ptr) bitmap_free(raw_block, ptr)
+
+/**
+ * Reallocates a memory block from a bitmap-organised raw block
+ *
+ * @param  raw_block The pointer of the bitmap-organised raw block.
+ * @param  ptr       The pointer of the memory block to be re-allocated.
+ * @param  size  The requested memory size.
+ * @retval           The address to serve the request.
+ * @retval NULL      No available memory space.
+ */
 #define dmmlib_realloc(raw_block, ptr, size) bitmap_realloc(raw_block, ptr, size)
+
 #endif /* BITMAP_RB_ONLY */
 
 void * bitmap_malloc(bitmap_rb_t *raw_block, size_t size);