summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 177b5dc..47a1ac4 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -238,9 +238,7 @@ H5S_close(H5S_t *ds)
break;
case H5S_SIMPLE:
- H5MM_xfree(ds->u.simple.size);
- H5MM_xfree(ds->u.simple.max);
- H5MM_xfree(ds->u.simple.perm);
+ H5S_close_simple(&(ds->u.simple));
break;
case H5S_COMPLEX:
@@ -262,6 +260,37 @@ H5S_close(H5S_t *ds)
}
/*-------------------------------------------------------------------------
+ * Function: H5S_close_simple
+ *
+ * Purpose: Releases all memory associated with a simple data space.
+ * (but doesn't free the simple space itself)
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, April 17, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5S_close_simple(H5S_simple_t *simple)
+{
+ FUNC_ENTER(H5S_close_simple, FAIL);
+
+ assert(simple);
+
+ H5MM_xfree(simple->size);
+ H5MM_xfree(simple->max);
+ H5MM_xfree(simple->perm);
+
+ FUNC_LEAVE(SUCCEED);
+}
+
+/*-------------------------------------------------------------------------
* Function: H5Scopy
*
* Purpose: Copies a dataspace.