summaryrefslogtreecommitdiffstats
path: root/src/H5Dearray.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-06-08 19:24:48 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-06-08 19:24:48 (GMT)
commit4242753848c44ab3b5d226e66225eac2f64db314 (patch)
tree6053b3f7deabf531b629a276fd9fb7fa1ad13f4b /src/H5Dearray.c
parentb0e79fe6dd20ec7aa1b3e5f0f8b370639a4ef5bd (diff)
parentd391d8a690b4d595709e1274882fb5e5e0559f9e (diff)
downloadhdf5-4242753848c44ab3b5d226e66225eac2f64db314.zip
hdf5-4242753848c44ab3b5d226e66225eac2f64db314.tar.gz
hdf5-4242753848c44ab3b5d226e66225eac2f64db314.tar.bz2
Merge pull request #567 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop to develop
Makes all non-global H5O_layout_t structs dynamic (quiets stack warnings). * commit 'd391d8a690b4d595709e1274882fb5e5e0559f9e': * Made STATIC free lists EXTERN for H5O_layout_t. * Made all non-global instances of H5O_layout_t in H5Pdcpl.c dynamic. Updated H5O_layout_t dynamic work to use the H5FL interface. Made some H5O_layout_t stack allocations dynamic (quiets warnings).
Diffstat (limited to 'src/H5Dearray.c')
-rw-r--r--src/H5Dearray.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index 1df0a58..a45d546 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -214,10 +214,13 @@ const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]={{
/*******************/
/* Declare a free list to manage the H5D_earray_ctx_t struct */
-/* Declare a free list to manage the H5D_earray_ctx_ud_t struct */
H5FL_DEFINE_STATIC(H5D_earray_ctx_t);
+
+/* Declare a free list to manage the H5D_earray_ctx_ud_t struct */
H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t);
+/* Declare a free list to manage the H5O_layout_t struct */
+H5FL_EXTERN(H5O_layout_t);
/*-------------------------------------------------------------------------
@@ -629,7 +632,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr)
H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
H5O_loc_t obj_loc; /* Pointer to an object's location */
hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */
- H5O_layout_t layout; /* Layout message */
+ H5O_layout_t *layout = NULL; /* Layout message */
void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -653,7 +656,9 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr)
obj_opened = TRUE;
/* Read the layout message */
- if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id))
+ if(NULL == (layout = H5FL_CALLOC(H5O_layout_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout")
+ if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info")
/* close the object header */
@@ -662,7 +667,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr)
/* Create user data */
dbg_ctx->f = f;
- dbg_ctx->chunk_size = layout.u.chunk.size;
+ dbg_ctx->chunk_size = layout->u.chunk.size;
/* Set return value */
ret_value = dbg_ctx;
@@ -681,6 +686,9 @@ done:
} /* end if */
} /* end if */
+ if(layout)
+ layout = H5FL_FREE(H5O_layout_t, layout);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__earray_crt_dbg_context() */