summaryrefslogtreecommitdiffstats
path: root/src/H5MM.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5MM.c')
-rw-r--r--src/H5MM.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/H5MM.c b/src/H5MM.c
index 14e847b..1de4880 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -112,14 +112,12 @@ H5MM_calloc(size_t size)
* Return: Success: Ptr to new memory or NULL if the memory
* was freed.
*
- * Failure: abort()
+ * Failure: NULL
*
* Programmer: Robb Matzke
* matzke@llnl.gov
* Jul 10 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -128,27 +126,24 @@ H5MM_realloc(void *mem, size_t size)
void *ret_value;
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_realloc);
-
- if (!mem) {
- if (0 == size)
- HGOTO_DONE(NULL);
- mem = H5MM_malloc(size);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_realloc)
- } else if (0 == size) {
+ if(NULL == mem) {
+ if(0 == size)
+ mem = NULL;
+ else
+ mem = H5MM_malloc(size);
+ } /* end if */
+ else if(0 == size)
mem = H5MM_xfree(mem);
-
- } else {
+ else
mem = HDrealloc(mem, size);
- assert(mem);
- }
/* Set return value */
- ret_value=mem;
+ ret_value = mem;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5MM_realloc() */
/*-------------------------------------------------------------------------