summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-06 13:13:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-06 13:13:05 (GMT)
commitfc152eff1c4a7118f43bddb6ac3c9b3c4d69bfac (patch)
tree32b827b1ee2be3a49f159225c2597de10a4cd248 /src/H5AC.c
parent3a0524dfa9d0067392c9a8bbb9a31934aa8e90ba (diff)
downloadhdf5-fc152eff1c4a7118f43bddb6ac3c9b3c4d69bfac.zip
hdf5-fc152eff1c4a7118f43bddb6ac3c9b3c4d69bfac.tar.gz
hdf5-fc152eff1c4a7118f43bddb6ac3c9b3c4d69bfac.tar.bz2
[svn-r8302] 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.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 8a45c56..80f1d55 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -131,14 +131,14 @@ static H5AC_t *current_cache_g = NULL; /*for sorting */
H5FL_DEFINE_STATIC(H5AC_t);
/* Declare a PQ free list to manage the cache mapping array information */
-H5FL_ARR_DEFINE_STATIC(int,-1);
+H5FL_SEQ_DEFINE_STATIC(int);
/* Declare a PQ free list to manage the cache slot array information */
-H5FL_ARR_DEFINE_STATIC(H5AC_info_ptr_t,-1);
+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);
+H5FL_SEQ_DEFINE_STATIC(H5AC_prot_t);
#endif /* H5AC_DEBUG */
@@ -371,12 +371,12 @@ H5AC_create(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 = 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 */
@@ -387,12 +387,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 */
@@ -442,12 +442,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);
@@ -787,7 +787,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(int,cache->nslots)))
+ if (NULL==(map=H5FL_SEQ_MALLOC(int,cache->nslots)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
#ifdef H5_HAVE_PARALLEL
/* If MPIO, MPIPOSIX, or FPHDF5 is used, do special parallel I/O actions */
@@ -1004,7 +1004,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(int,map);
+ map = H5FL_SEQ_FREE(int,map);
FUNC_LEAVE_NOAPI(ret_value);
}