2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3
Copyright (C) 2005- The University of Notre Dame
4
This software is distributed under the GNU General Public License.
5
See the file COPYING for details.
14
Brittle memory allocation routines.
15
These routines may be used in place of <tt>malloc</tt> and <tt>strdup</tt>.
16
If they fail due to the (rare) possibility of heap exhaustion, they will
17
abort by calling @ref fatal with an appropriate error message. Thus, the
18
caller of these routines need not continually check for a null pointer return.
21
/** Allocate memory, or abort on failure.
22
@param nbytes The amount of memory to allocate.
23
@return On success, returns a valid pointer. On failure, aborts by calling @ref fatal.
25
void *xxmalloc(size_t nbytes);
27
void *xxrealloc(void *ptr, size_t nbytes);
29
/** Duplicate string, or abort on failure.
30
@param str The string to duplicate.
31
@return On success, returns a valid pointer. On failure, aborts by calling @ref fatal.
34
char *xxstrdup(const char *str);