summaryrefslogtreecommitdiffstats
path: root/src/H5FL.c
diff options
context:
space:
mode:
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 */