Changing domain name
[llvm-complete.git] / utils / Burg / zalloc.c
blobf521a4d91dcb788bcf674b5bac58edf37a91a19a
1 char rcsid_zalloc[] = "$Id$";
3 #include <stdio.h>
4 #include <string.h>
5 #include <stdlib.h>
6 #include "b.h"
8 int
9 fatal(const char *name, int line)
11 fprintf(stderr, "assertion failed: file %s, line %d\n", name, line);
12 exit(1);
13 return 0;
16 void *
17 zalloc(size) unsigned int size;
19 void *t = (void *) malloc(size);
20 if (!t) {
21 fprintf(stderr, "Malloc failed---PROGRAM ABORTED\n");
22 exit(1);
24 memset(t, 0, size);
25 return t;
28 void
29 zfree(p) void *p;
31 free(p);