Browse Source

Disabled used blocks head and roving pointer for the time being.

Ioannis Koutras 13 years ago
parent
commit
beb0dcc26d
6 changed files with 9 additions and 2 deletions
  1. 0 1
      CMakeLists.txt
  2. 2 0
      include/dmmlib/heap.h
  3. 2 0
      src/custom_free.c
  4. 2 0
      src/custom_malloc.c
  5. 2 0
      src/initialize_allocator.c
  6. 1 1
      src/sys_alloc.c

+ 0 - 1
CMakeLists.txt

@@ -9,7 +9,6 @@ include(DefineOptions.cmake)
 include(MacroEnsureOutOfSourceBuild)
 macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
 
-
 if(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST)
   add_definitions(-std=c99)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes")  

+ 2 - 0
include/dmmlib/heap.h

@@ -99,8 +99,10 @@ typedef struct heap_s {
 	maptable_node_t *maptable_head; /**< The head of the maptable list. */
 #endif /* WITH_FIXED_LISTS */
 	void *free_list_head; /**< The head of the free list. */
+#ifdef FUTURE_FEATURES
 	void *used_blocks_head; /**< The head of the used blocks list. */
 	void *rov_ptr; /**< Roving pointer. */
+#endif /* FUTURE_FEATURES */
 #ifndef LEON3
 	uint64_t num_objects; /**< Number of objects in the heap. */
 #else

+ 2 - 0
src/custom_free.c

@@ -58,7 +58,9 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
     posix_lock(heap);
 #endif /* HAVE_LOCKS */
 
+#ifdef FUTURE_FEATURES
     remove_block(&ptr, &heap->used_blocks_head);
+#endif /* FUTURE_FEATURES */
 
 #ifdef WITH_STATS
     heap->dmm_stats.mem_allocated -= size;

+ 2 - 0
src/custom_malloc.c

@@ -104,8 +104,10 @@ void * custom_ahmalloc(allocator_t* allocator, heap_t* heap, size_t size) {
         mark_used(ptr);
 #endif /* (SPLITTING_FIXED) || (SPLITTING_VARIABLE) */
 
+#ifdef FUTURE_FEATURES
         /* Update the used blocks list */
         push_block(&ptr, &heap->used_blocks_head);
+#endif /* FUTURE_FEATURES */
 
 #ifdef WITH_STATS
         /* Update statistics */

+ 2 - 0
src/initialize_allocator.c

@@ -45,8 +45,10 @@ void initialize_allocator(allocator_t *allocator) {
         allocator->heaps[i].maptable_head = NULL;
 #endif /* WITH_FIXED_LISTS */
         allocator->heaps[i].free_list_head = NULL;
+#ifdef FUTURE_FEATURES
         allocator->heaps[i].used_blocks_head = NULL;
         allocator->heaps[i].rov_ptr = NULL;
+#endif /* FUTURE_FEATURES */
         allocator->heaps[i].num_objects = 0;
 
 #ifdef WITH_STATS

+ 1 - 1
src/sys_alloc.c

@@ -110,10 +110,10 @@ void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
 
 #ifdef FUTURE_FEATURES
     set_requested_size(ptr, size);
-#endif /* FUTURE_FEATURES */
 
     /* Update the used blocks list */
     push_block(&ptr, &heap->used_blocks_head);
+#endif /* FUTURE_FEATURES */
 
 #ifdef WITH_STATS
     /* Update statistics */