Browse Source

fix warnings and errors in freelist/realloc()

iraklis 11 years ago
parent
commit
6d0cd147d0
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/freelist/realloc.c

+ 5 - 4
src/freelist/realloc.c

@@ -27,6 +27,7 @@
 #include "freelist/block_header_funcs.h"
 
 /* for freelist_free() functionality */
+#include "freelist/ordering_policy.h"
 #if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
 #include "freelist/coalesce.h"
 #endif /* COALESCING_FIXED || COALESCING_VARIABLE */
@@ -58,17 +59,17 @@ void * freelist_realloc(freelist_rb_t *raw_block, void *ptr,
     block_header_t *block;
     void *ret;
 
-#ifdef REQUEST_SIZE_INFO
+#if defined (WITH_ALLOCATOR_STATS) && defined (REQUEST_SIZE_INFO)
     size_t unmodified_req_size = req_size;
-#endif /* REQUEST_SIZE_INFO */
+#endif /* WITH_ALLOCATOR_STATS && REQUEST_SIZE_INFO */
 
     req_size = req_padding(req_size);
 
     block = get_header(ptr);
 
-#ifdef REQUEST_SIZE_INFO
+#if defined (WITH_ALLOCATOR_STATS) && defined (REQUEST_SIZE_INFO)
     size_t original_req_size = get_requested_size(block);
-#endif /* REQUEST_SIZE_INFO */
+#endif /* WITH_ALLOCATOR_STATS && REQUEST_SIZE_INFO */
 
     if(get_size(block) > req_size) {
         /* TODO Maybe create a memory block in the unneeded space */