Selaa lähdekoodia

Added comments on raw block and bitmap raw block's data structures

Ioannis Koutras 12 vuotta sitten
vanhempi
commit
bb05473edb
2 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 2 1
      include/dmmlib/raw_block.h
  2. 7 4
      private-include/bitmap/bitmap_rb.h

+ 2 - 1
include/dmmlib/raw_block.h

@@ -33,6 +33,7 @@
 #include <pthread.h> /* FIXME To be removed once mutex is removed. */
 #endif /* HAVE_LOCKS */
 
+/** Enumeration of raw block's different types */
 typedef enum rb_type_en {
 #ifdef FL_RB_ONLY
     FREELIST,
@@ -45,7 +46,7 @@ typedef enum rb_type_en {
 
 /** The header structure of every raw block inside a heap. */
 typedef struct raw_block_header_s {
-    rb_type type;
+    rb_type type; /**< The type of the raw block. */
     size_t size; /**< Total available size of the raw block. */
     struct raw_block_header_s *next_raw_block; /**< Pointer to the next raw
                                                  block. */

+ 7 - 4
private-include/bitmap/bitmap_rb.h

@@ -29,16 +29,19 @@
 #include <inttypes.h>
 #include <stddef.h> /* for size_t */
 
+/** The data type of the bitmap array element */
 #define BMAP_EL_TYPE uint64_t
+/** The size of bitmap array element in bits */
 #define BMAP_EL_SIZE_BITS (sizeof(BMAP_EL_TYPE) * 8)
-
+/** The number of bitmap array elements */
 #define BMAP_INDEX_NUM 20
 
 /** Bitmap-organized raw block header data structure */
 typedef struct bitmap_rb_s {
-    BMAP_EL_TYPE bmap_array[BMAP_INDEX_NUM];
-    size_t bytes_per_cell; /* FIXME - As long as the bitmap arrays are
-                              fixed-sized, this is also fixed */
+    BMAP_EL_TYPE bmap_array[BMAP_INDEX_NUM]; /**< The bitmap vector */
+    size_t bytes_per_cell; /**< The raw block's resolution */
+    /* FIXME - As long as the bitmap arrays are fixed-sized,
+     * this is also fixed */
 } bitmap_rb_t;
 
 /** Chunk header data structure */