summaryrefslogtreecommitdiffstats
path: root/src/H5FL.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-04-08 03:46:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-04-08 03:46:48 (GMT)
commit13ca97618db62034fa78b8d87f7160cb2a1f4bfc (patch)
tree08409d4a9670de57059d50e7dc4790d7d88ded43 /src/H5FL.c
parentd4ab501d637389fc8f6dbae8ab12c6e032b19dfd (diff)
downloadhdf5-13ca97618db62034fa78b8d87f7160cb2a1f4bfc.zip
hdf5-13ca97618db62034fa78b8d87f7160cb2a1f4bfc.tar.gz
hdf5-13ca97618db62034fa78b8d87f7160cb2a1f4bfc.tar.bz2
[svn-r10580] Purpose:
Code optimization Description: Add "base" size to array free list code, to accomodate skip list nodes. Platforms tested: FreeBSD 4.11 (sleipnir) Solaris 2.9 (shanti)
Diffstat (limited to 'src/H5FL.c')
-rw-r--r--src/H5FL.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5FL.c b/src/H5FL.c
index 4b39fd9..40483c8 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -1275,8 +1275,8 @@ H5FL_arr_init(H5FL_arr_head_t *head)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Initialize the size of each array */
- for(u=1; u<(size_t)head->maxelem; u++)
- head->list_arr[u].size=head->size*u;
+ for(u = 0; u<(size_t)head->maxelem; u++)
+ head->list_arr[u].size = head->base_size + (head->elem_size * u);
/* Indicate that the free list is initialized */
head->init=1;
@@ -1521,7 +1521,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem)
ret_value=H5FL_arr_malloc(head,new_elem);
/* Copy the appropriate amount of elements */
- blk_size=head->size*MIN(temp->nelem,new_elem);
+ blk_size = head->list_arr[ MIN(temp->nelem, new_elem) ].size;
HDmemcpy(ret_value,obj,blk_size);
/* Free the old block */