mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
[svn-r8675] Purpose:
Code optimization Description: Using existing dataspace extent copying routine instead of duplicating the code (more slowly). Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest
This commit is contained in:
parent
925f2ba710
commit
986f335251
@ -1591,10 +1591,6 @@ H5A_close(H5A_t *attr)
|
||||
if(H5O_close(&(attr->ent))<0)
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info")
|
||||
|
||||
#ifndef LATER
|
||||
/* Do something with the shared information? */
|
||||
#endif
|
||||
|
||||
H5MM_xfree(attr);
|
||||
|
||||
done:
|
||||
|
@ -314,26 +314,9 @@ H5O_sdspace_copy(const void *mesg, void *dest)
|
||||
if (!dst && NULL==(dst = H5FL_MALLOC(H5S_extent_t)))
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
||||
|
||||
/* deep copy -- pointed-to values are copied also */
|
||||
HDmemcpy(dst, src, sizeof(H5S_extent_t));
|
||||
|
||||
if (src->u.simple.size) {
|
||||
if (NULL==(dst->u.simple.size = H5FL_ARR_MALLOC(hsize_t,src->u.simple.rank)))
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
||||
HDmemcpy (dst->u.simple.size, src->u.simple.size, src->u.simple.rank*sizeof(src->u.simple.size[0]));
|
||||
}
|
||||
if (src->u.simple.max) {
|
||||
if (NULL==(dst->u.simple.max=H5FL_ARR_MALLOC(hsize_t,src->u.simple.rank)))
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
||||
HDmemcpy (dst->u.simple.max, src->u.simple.max, src->u.simple.rank*sizeof(src->u.simple.max[0]));
|
||||
}
|
||||
#ifdef LATER
|
||||
if (src->u.simple.perm) {
|
||||
if (NULL==(dst->u.simple.perm=H5FL_ARR_MALLOC(hsize_t,src->u.simple.rank)))
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
||||
HDmemcpy (dst->u.simple.perm, src->u.simple.perm, src->u.simple.rank*sizeof(src->u.simple.perm[0]));
|
||||
}
|
||||
#endif
|
||||
/* Copy extent information */
|
||||
if(H5S_extent_copy(dst,src)<0)
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent");
|
||||
|
||||
/* Set return value */
|
||||
ret_value=dst;
|
||||
@ -400,8 +383,8 @@ done:
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Wednesday, March 31, 2004
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 30, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
@ -429,8 +412,8 @@ done:
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Wednesday, March 31, 2004
|
||||
* Programmer: Quincey Koziol
|
||||
* Thursday, March 30, 2000
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user