diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-13 20:11:38 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-06-13 20:11:38 (GMT) |
commit | 986f3352516ce62e401516d65a39dc27612abf8e (patch) | |
tree | da0a6215fddd3a7d7182993906f02eb8873ca834 /src/H5Osdspace.c | |
parent | 925f2ba71017081543f904a6a113055432693dab (diff) | |
download | hdf5-986f3352516ce62e401516d65a39dc27612abf8e.zip hdf5-986f3352516ce62e401516d65a39dc27612abf8e.tar.gz hdf5-986f3352516ce62e401516d65a39dc27612abf8e.tar.bz2 |
[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
Diffstat (limited to 'src/H5Osdspace.c')
-rw-r--r-- | src/H5Osdspace.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 4f2515e..d558d33 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -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: * |