summaryrefslogtreecommitdiffstats
path: root/src/H5HG.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/H5HG.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/H5HG.c')
-rw-r--r--src/H5HG.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index b4b7f17..55f611f 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -139,8 +139,8 @@ static int interface_initialize_g = 0;
/* Declare a free list to manage the H5HG_t struct */
H5FL_DEFINE_STATIC(H5HG_heap_t);
-/* Declare a free list to manage arrays of H5HG_obj_t's */
-H5FL_ARR_DEFINE_STATIC(H5HG_obj_t,-1);
+/* Declare a free list to manage sequences of H5HG_obj_t's */
+H5FL_SEQ_DEFINE_STATIC(H5HG_obj_t);
/* Declare a PQ free list to manage heap chunks */
H5FL_BLK_DEFINE_STATIC(heap_chunk);
@@ -196,7 +196,7 @@ H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size)
if (NULL==(heap->chunk = H5FL_BLK_MALLOC (heap_chunk,size)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
heap->nalloc = H5HG_NOBJS (f, size);
- if (NULL==(heap->obj = H5FL_ARR_CALLOC (H5HG_obj_t,heap->nalloc)))
+ if (NULL==(heap->obj = H5FL_SEQ_CALLOC (H5HG_obj_t,heap->nalloc)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
/* Initialize the header */
@@ -334,7 +334,7 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1,
/* Decode each object */
p = heap->chunk + H5HG_SIZEOF_HDR (f);
nalloc = H5HG_NOBJS (f, heap->size);
- if (NULL==(heap->obj = H5FL_ARR_CALLOC (H5HG_obj_t,nalloc)))
+ if (NULL==(heap->obj = H5FL_SEQ_CALLOC (H5HG_obj_t,nalloc)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
heap->nalloc = nalloc;
while (p<heap->chunk+heap->size) {
@@ -497,7 +497,7 @@ H5HG_dest (H5F_t *f, H5HG_heap_t *heap)
}
}
heap->chunk = H5FL_BLK_FREE(heap_chunk,heap->chunk);
- heap->obj = H5FL_ARR_FREE(H5HG_obj_t,heap->obj);
+ heap->obj = H5FL_SEQ_FREE(H5HG_obj_t,heap->obj);
H5FL_FREE (H5HG_heap_t,heap);
FUNC_LEAVE_NOAPI(SUCCEED);