summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-06 13:11:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-06 13:11:45 (GMT)
commit43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8 (patch)
treea965cb03f135b474e8f303bc72ba2a17de8209d0 /src/H5AC.c
parent4c8f0b2463410eff8a0a6c4531ad051d7c33abd1 (diff)
downloadhdf5-43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8.zip
hdf5-43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8.tar.gz
hdf5-43d3a9bfe8dfc060615b4a0f133ebf35bcb0f2f8.tar.bz2
[svn-r8301] Purpose:
Code optimization Description: Move handling for free list arrays that have no maximum size to separate set of routines and optimize computations for free list arrays with maximum size to avoid re-computing sizes all the time. Platforms tested: h5committest Solaris 2.7 (arabica)
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index cbdceac..fb0bafb 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -130,15 +130,15 @@ static H5AC_t *current_cache_g = NULL; /*for sorting */
/* Declare a free list to manage the H5AC_t struct */
H5FL_DEFINE_STATIC(H5AC_t);
-/* Declare a PQ free list to manage the cache mapping array information */
-H5FL_ARR_DEFINE_STATIC(unsigned,-1);
+/* Declare a free list to manage the cache mapping sequence information */
+H5FL_SEQ_DEFINE_STATIC(unsigned);
-/* Declare a PQ free list to manage the cache slot array information */
-H5FL_ARR_DEFINE_STATIC(H5AC_info_ptr_t,-1);
+/* Declare a free list to manage the cache slot sequence information */
+H5FL_SEQ_DEFINE_STATIC(H5AC_info_ptr_t);
#ifdef H5AC_DEBUG
-/* Declare a PQ free list to manage the protected slot array information */
-H5FL_ARR_DEFINE_STATIC(H5AC_prot_t,-1);
+/* Declare a free list to manage the protected slot sequence information */
+H5FL_SEQ_DEFINE_STATIC(H5AC_prot_t);
#endif /* H5AC_DEBUG */
@@ -374,12 +374,12 @@ H5AC_create(const H5F_t *f, int size_hint)
if (NULL==(f->shared->cache = cache = H5FL_CALLOC(H5AC_t)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
cache->nslots = (unsigned)size_hint;
- if (NULL==( cache->slot = H5FL_ARR_CALLOC(H5AC_info_ptr_t,cache->nslots)))
+ if (NULL==( cache->slot = H5FL_SEQ_CALLOC(H5AC_info_ptr_t,cache->nslots)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- if (NULL==( cache->dslot = H5FL_ARR_CALLOC(H5AC_info_ptr_t,cache->nslots)))
+ if (NULL==( cache->dslot = H5FL_SEQ_CALLOC(H5AC_info_ptr_t,cache->nslots)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
#ifdef H5AC_DEBUG
- if ((cache->prot = H5FL_ARR_CALLOC(H5AC_prot_t,cache->nslots))==NULL)
+ if ((cache->prot = H5FL_SEQ_CALLOC(H5AC_prot_t,cache->nslots))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
#endif /* H5AC_DEBUG */
@@ -390,12 +390,12 @@ done:
if(ret_value<0) {
if(cache!=NULL) {
if(cache->dslot !=NULL)
- cache->dslot = H5FL_ARR_FREE (H5AC_info_ptr_t,cache->dslot);
+ cache->dslot = H5FL_SEQ_FREE (H5AC_info_ptr_t,cache->dslot);
if(cache->slot !=NULL)
- cache->slot = H5FL_ARR_FREE (H5AC_info_ptr_t,cache->slot);
+ cache->slot = H5FL_SEQ_FREE (H5AC_info_ptr_t,cache->slot);
#ifdef H5AC_DEBUG
if(cache->prot !=NULL)
- cache->prot = H5FL_ARR_FREE (H5AC_prot_t,cache->prot);
+ cache->prot = H5FL_SEQ_FREE (H5AC_prot_t,cache->prot);
#endif /* H5AC_DEBUG */
f->shared->cache = H5FL_FREE (H5AC_t,f->shared->cache);
} /* end if */
@@ -445,12 +445,12 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
cache->prot[i].aprots = 0;
cache->prot[i].nprots = 0;
}
- cache->prot = H5FL_ARR_FREE(H5AC_prot_t,cache->prot);
+ cache->prot = H5FL_SEQ_FREE(H5AC_prot_t,cache->prot);
}
#endif
- cache->dslot = H5FL_ARR_FREE(H5AC_info_ptr_t,cache->dslot);
- cache->slot = H5FL_ARR_FREE(H5AC_info_ptr_t,cache->slot);
+ cache->dslot = H5FL_SEQ_FREE(H5AC_info_ptr_t,cache->dslot);
+ cache->slot = H5FL_SEQ_FREE(H5AC_info_ptr_t,cache->slot);
cache->nslots = 0;
f->shared->cache = cache = H5FL_FREE(H5AC_t,cache);
@@ -565,7 +565,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, unsi
* Sort the cache entries by address since flushing them in
* ascending order by address is much more efficient.
*/
- if (NULL==(map=H5FL_ARR_MALLOC(unsigned,cache->nslots)))
+ if (NULL==(map=H5FL_SEQ_MALLOC(unsigned,cache->nslots)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
#ifdef H5_HAVE_PARALLEL
/* If MPI based VFD is used, do special parallel I/O actions */
@@ -782,7 +782,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, unsi
done:
if(map!=NULL)
- map = H5FL_ARR_FREE(unsigned,map);
+ map = H5FL_SEQ_FREE(unsigned,map);
FUNC_LEAVE_NOAPI(ret_value)
}