summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index c420046..f685a00c 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -200,7 +200,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
* What's actually shared, though, is only the extent.
*/
if(NULL == (attr->shared->ds = H5FL_CALLOC(H5S_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Decode attribute's dataspace extent */
if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, open_oh,
@@ -208,7 +208,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace")
/* Copy the extent information to the dataspace */
- HDmemcpy(&(attr->shared->ds->extent), extent, sizeof(H5S_extent_t));
+ H5MM_memcpy(&(attr->shared->ds->extent), extent, sizeof(H5S_extent_t));
/* Release temporary extent information */
extent = H5FL_FREE(H5S_extent_t, extent);
@@ -240,7 +240,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
if(attr->shared->data_size) {
if(NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, attr->shared->data_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- HDmemcpy(attr->shared->data, p, attr->shared->data_size);
+ H5MM_memcpy(attr->shared->data, p, attr->shared->data_size);
} /* end if */
/* Increment the reference count for this object header message in cache(compact
@@ -253,15 +253,11 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
done:
if(NULL == ret_value)
if(attr) {
- if(attr->shared) {
- /* Free any dynamically allocated items */
- if(H5A__free(attr) < 0)
+ /* Free any dynamically allocated items */
+ if(attr->shared)
+ if(H5A__shared_free(attr) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info")
- /* Destroy shared attribute struct */
- attr->shared = H5FL_FREE(H5A_shared_t, attr->shared);
- } /* end if */
-
attr = H5FL_FREE(H5A_t, attr);
} /* end if */
@@ -336,7 +332,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
*p++ = attr->shared->encoding;
/* Write the name including null terminator */
- HDmemcpy(p, attr->shared->name, name_len);
+ H5MM_memcpy(p, attr->shared->name, name_len);
if(attr->shared->version < H5O_ATTR_VERSION_2) {
/* Pad to the correct number of bytes */
HDmemset(p + name_len, 0, H5O_ALIGN_OLD(name_len) - name_len);
@@ -369,7 +365,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
/* Store attribute data. If there's no data, store 0 as fill value. */
if(attr->shared->data)
- HDmemcpy(p, attr->shared->data, attr->shared->data_size);
+ H5MM_memcpy(p, attr->shared->data, attr->shared->data_size);
else
HDmemset(p, 0, attr->shared->data_size);