Browse CVS Repository
Contents of /caraway/caraway/gc.c
Parent Directory
| Revision Log
| Revision Graph
Revision 1.1.1.1 -
( show annotations)
( download)
( as text)
(vendor branch)
Tue Jan 24 07:38:06 2006 UTC
(18 years, 2 months ago)
by reno
Branch: MAIN, reno
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/x-csrc
initial import into cvs
| 1 |
#include "caraway.h" |
| 2 |
#include <stdlib.h> |
| 3 |
#include <string.h> |
| 4 |
|
| 5 |
inline void *cw_xmalloc( long size ) |
| 6 |
{ |
| 7 |
return malloc(size); |
| 8 |
} |
| 9 |
|
| 10 |
inline void *cw_xmalloc2( long n, long size ) |
| 11 |
{ |
| 12 |
return cw_xmalloc(n * size); |
| 13 |
} |
| 14 |
|
| 15 |
inline void *cw_xcalloc( long n, long size ) |
| 16 |
{ |
| 17 |
void *mem; |
| 18 |
|
| 19 |
mem = cw_xmalloc2(n, size); |
| 20 |
memset(mem, 0, n * size); |
| 21 |
|
| 22 |
return mem; |
| 23 |
} |
| 24 |
|
| 25 |
inline void *cw_xrealloc( void *ptr, long size ) |
| 26 |
{ |
| 27 |
return realloc(ptr, size); |
| 28 |
} |
| 29 |
|
| 30 |
inline void *cw_xrealloc2( void *ptr, long n, long size ) |
| 31 |
{ |
| 32 |
return cw_xrealloc(ptr, n * size); |
| 33 |
} |
| 34 |
|
| 35 |
inline void cw_xfree( void *x ) |
| 36 |
{ |
| 37 |
free(x); |
| 38 |
} |
| 39 |
|
| |