Browse Source

Added requested size info for requests on bitmap-organized raw blocks

Ioannis Koutras 12 years ago
parent
commit
0d2478f148
2 changed files with 4 additions and 0 deletions
  1. 1 0
      private-include/bitmap/bitmap_rb.h
  2. 3 0
      src/bitmap/bitmap_malloc.c

+ 1 - 0
private-include/bitmap/bitmap_rb.h

@@ -44,6 +44,7 @@ typedef struct bitmap_rb_s {
 /** Chunk header data structure */
 typedef struct chunk_header_s {
     size_t num_of_cells; /**< The number of occupied cells. */
+    size_t requested_size; /**< The requested size. */
 } chunk_header_t;
 
 #endif /* BITMAP_RB_H */

+ 3 - 0
src/bitmap/bitmap_malloc.c

@@ -100,6 +100,9 @@ void * bitmap_malloc(raw_block_header_t *raw_block, size_t req_size) {
                     (i * BMAP_EL_SIZE_BITS + found - 1) *
                     rb_header->bytes_per_cell);
             chunk_address->num_of_cells = cells;
+#ifdef REQUEST_SIZE_INFO
+            chunk_address->requested_size = req_size;
+#endif /* REQUEST_SIZE_INFO */
 
             ret = (void *)((char *)chunk_address + sizeof(chunk_header_t));