diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-04-08 03:46:48 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-04-08 03:46:48 (GMT) |
commit | 13ca97618db62034fa78b8d87f7160cb2a1f4bfc (patch) | |
tree | 08409d4a9670de57059d50e7dc4790d7d88ded43 /src/H5FL.c | |
parent | d4ab501d637389fc8f6dbae8ab12c6e032b19dfd (diff) | |
download | hdf5-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 */ |