File: xmalloc.h

package info (click to toggle)
birthday 1.6.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 696 kB
  • sloc: ansic: 1,443; makefile: 55; sh: 44; perl: 32
file content (32 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
	Fatal-on-failure memory allocation

	$Id: xmalloc.h,v 1.1 2005/07/19 18:50:00 andymort Exp $
*/

#ifndef xmalloc_h_INCLUDED
#define xmalloc_h_INCLUDED

#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

/* memory allocation */
void *xmalloc (size_t size);
void *xrealloc (void *ptr, size_t size);

/* exit with fatal error */
#ifdef __GNUC__
/* tell GCC more about the function, so it can optimise/debug better */
void fatal(char *fmt, ...) __attribute__ ((noreturn,format(printf,1,2)));
#else /* __GNUC__ */
void fatal(char *fmt, ...);
#endif /* __GNUC__ */

#ifdef __cplusplus
}
#endif

#endif