summaryrefslogtreecommitdiffstats
path: root/src/H5FL.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-07-12 18:49:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-07-12 18:49:39 (GMT)
commitb40a61794072394a12edadd43309b5a12d885ac4 (patch)
tree84a80f271dfbdd3732c660dc3abfe824e80ab81b /src/H5FL.c
parent5607e34da0650f919ed7cb6a3b9dcb7a6c27f02d (diff)
downloadhdf5-b40a61794072394a12edadd43309b5a12d885ac4.zip
hdf5-b40a61794072394a12edadd43309b5a12d885ac4.tar.gz
hdf5-b40a61794072394a12edadd43309b5a12d885ac4.tar.bz2
[svn-r5785] Purpose:
Code update Description: Re-arrange to disable free-list code in a more transparent way. Platforms tested: FreeBSD 4.6 (sleipnir)
Diffstat (limited to 'src/H5FL.c')
-rw-r--r--src/H5FL.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/H5FL.c b/src/H5FL.c
index bcd6b3f..cf14880 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -86,14 +86,6 @@ typedef struct H5FL_blk_gc_list_t {
/* The head of the list of PQs to garbage collect */
static H5FL_blk_gc_list_t H5FL_blk_gc_head={0,NULL};
-/* Macros for turning off free lists in the library */
-/* #define NO_FREE_LISTS */
-#ifdef NO_FREE_LISTS
-#define NO_REG_FREE_LISTS
-#define NO_ARR_FREE_LISTS
-#define NO_BLK_FREE_LISTS
-#endif /* NO_FREE_LISTS */
-
/* Forward declarations of local static functions */
static herr_t H5FL_reg_gc(void);
static herr_t H5FL_reg_gc_list(H5FL_reg_head_t *head);
@@ -220,9 +212,6 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj)
HDmemset(obj,255,head->size);
#endif /* H5FL_DEBUG */
-#ifdef NO_REG_FREE_LISTS
- H5MM_xfree(obj);
-#else /* NO_REG_FREE_LISTS */
/* Make certain that the free list is initialized */
assert(head->init);
@@ -251,8 +240,6 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj)
if(H5FL_reg_gc_head.mem_freed>H5FL_reg_glb_mem_lim)
H5FL_reg_gc();
-#endif /* NO_REG_FREE_LISTS */
-
FUNC_LEAVE(NULL);
} /* end H5FL_reg_free() */
@@ -282,12 +269,6 @@ H5FL_reg_alloc(H5FL_reg_head_t *head, unsigned clear)
/* Double check parameters */
assert(head);
-#ifdef NO_REG_FREE_LISTS
- if(clear)
- ret_value=H5MM_calloc(head->size);
- else
- ret_value=H5MM_malloc(head->size);
-#else /* NO_REG_FREE_LISTS */
/* Make certain the list is initialized first */
if(!head->init)
H5FL_reg_init(head);
@@ -321,7 +302,6 @@ H5FL_reg_alloc(H5FL_reg_head_t *head, unsigned clear)
if(clear) {
HDmemset(ret_value,0,head->size);
} /* end if */
-#endif /* NO_REG_FREE_LISTS */
FUNC_LEAVE (ret_value);
} /* end H5FL_reg_alloc() */
@@ -677,12 +657,6 @@ H5FL_blk_alloc(H5FL_blk_head_t *head, size_t size, unsigned clear)
/* Double check parameters */
assert(head);
-#ifdef NO_BLK_FREE_LISTS
- if(clear)
- ret_value=H5MM_calloc(size);
- else
- ret_value=H5MM_malloc(size);
-#else /* NO_BLK_FREE_LISTS */
/* Make certain the list is initialized first */
if(!head->init)
H5FL_blk_init(head);
@@ -728,7 +702,6 @@ H5FL_blk_alloc(H5FL_blk_head_t *head, size_t size, unsigned clear)
if(clear) {
HDmemset(ret_value,0,size);
} /* end if */
-#endif /* NO_BLK_FREE_LISTS */
done:
FUNC_LEAVE(ret_value);
@@ -766,9 +739,6 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
assert(head);
assert(block);
-#ifdef NO_BLK_FREE_LISTS
- H5MM_xfree(block);
-#else /* NO_BLK_FREE_LISTS */
/* Get the pointer to the native block info header in front of the native block to free */
temp=(H5FL_blk_list_t *)((unsigned char *)block-sizeof(H5FL_blk_list_t));
@@ -803,8 +773,6 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
if(H5FL_blk_gc_head.mem_freed>H5FL_blk_glb_mem_lim)
H5FL_blk_gc();
-#endif /* NO_BLK_FREE_LISTS */
-
FUNC_LEAVE(NULL);
} /* end H5FL_blk_free() */
@@ -838,9 +806,6 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size)
/* Double check parameters */
assert(head);
-#ifdef NO_BLK_FREE_LISTS
- ret_value=H5MM_realloc(block,new_size);
-#else /* NO_BLK_FREE_LISTS */
/* Check if we are actually re-allocating a block */
if(block!=NULL) {
/* Get the pointer to the chunk info header in front of the chunk to free */
@@ -860,7 +825,6 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size)
/* Not re-allocating, just allocate a fresh block */
else
ret_value=H5FL_blk_alloc(head,new_size,0);
-#endif /* NO_BLK_FREE_LISTS */
done:
FUNC_LEAVE(ret_value);
@@ -1113,9 +1077,6 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj)
FUNC_ENTER_NOAPI(H5FL_arr_free, NULL);
-#ifdef NO_ARR_FREE_LISTS
- H5MM_xfree(obj);
-#else /* NO_ARR_FREE_LISTS */
/* The H5MM_xfree code allows obj to null */
if (!obj)
HRETURN (NULL);
@@ -1167,7 +1128,6 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj)
else {
H5FL_blk_free(&(head->u.queue),obj);
} /* end else */
-#endif /* NO_ARR_FREE_LISTS */
FUNC_LEAVE(NULL);
} /* end H5FL_arr_free() */
@@ -1200,12 +1160,6 @@ H5FL_arr_alloc(H5FL_arr_head_t *head, size_t elem, unsigned clear)
/* Double check parameters */
assert(head);
-#ifdef NO_ARR_FREE_LISTS
- if(clear)
- ret_value=H5MM_calloc(elem*head->size);
- else
- ret_value=H5MM_malloc(elem*head->size);
-#else /* NO_ARR_FREE_LISTS */
/* Make certain the list is initialized first */
if(!head->init)
H5FL_arr_init(head);
@@ -1260,7 +1214,6 @@ H5FL_arr_alloc(H5FL_arr_head_t *head, size_t elem, unsigned clear)
else {
ret_value=H5FL_blk_alloc(&(head->u.queue),mem_size,clear);
} /* end else */
-#endif /* NO_ARR_FREE_LISTS */
FUNC_LEAVE (ret_value);
} /* end H5FL_arr_alloc() */
@@ -1293,9 +1246,6 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem)
/* Double check parameters */
assert(head);
-#ifdef NO_ARR_FREE_LISTS
- ret_value=H5MM_realloc(obj,new_elem*head->size);
-#else /* NO_ARR_FREE_LISTS */
/* Check if we are really allocating the object */
if(obj==NULL) {
ret_value=H5FL_arr_alloc(head,new_elem,0);
@@ -1326,7 +1276,6 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem)
ret_value=H5FL_blk_realloc(&(head->u.queue),obj,head->size*new_elem);
} /* end else */
} /* end else */
-#endif /* NO_ARR_FREE_LISTS */
FUNC_LEAVE (ret_value);
} /* end H5FL_arr_realloc() */