~ubuntu-branches/ubuntu/trusty/cctools/trusty

« back to all changes in this revision

Viewing changes to dttools/src/xxmalloc.h

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2012-06-15 08:30:02 UTC
  • mfrom: (9.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120615083002-r5nq7iowcv6bm35n
Tags: 3.5.0-1
* New upstream release.
* Remove obsolete patches 'missing_cflags' and 'python_compat'. They have
  been merged upstream.
* Remove DM-upload flag, not needed anymore.
* Bumped Standards-version to 3.9.3, no changes necessary.
* Do not install the new 'apps' binaries. They carry language-specific
  filename extensions, and upstream was asked if renaming is possible. Until
  this is decided they won't be installed to avoid changing the API twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
6
*/
 
7
 
 
8
#include <sys/types.h>
 
9
 
 
10
#ifndef XXMALLOC_H
 
11
#define XXMALLOC_H
 
12
 
 
13
/** @file xxmalloc.h
 
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.
 
19
*/
 
20
 
 
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.
 
24
*/
 
25
void *xxmalloc(size_t nbytes);
 
26
 
 
27
void *xxrealloc(void *ptr, size_t nbytes);
 
28
 
 
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.
 
32
*/
 
33
 
 
34
char *xxstrdup(const char *str);
 
35
 
 
36
#endif