|
|
1.1 ! root 1: # include <useful.h> ! 2: # include <sccs.h> ! 3: ! 4: SCCSID(@(#)xalloc.c 8.1 12/31/84) ! 5: ! 6: /* ! 7: ** XALLOC -- allocate block of memory. ! 8: ** ! 9: ** This is just like malloc, except that it is guaranteed ! 10: ** to succeed. It will syserr if it fails. ! 11: ** ! 12: ** Parameters: ! 13: ** sz -- size in bytes of memory area to allocate. ! 14: ** ! 15: ** Returns: ! 16: ** pointer to area allocated. ! 17: ** ! 18: ** Side Effects: ! 19: ** none. ! 20: ** ! 21: ** Trace Flags: ! 22: ** none. ! 23: */ ! 24: ! 25: char * ! 26: xalloc(sz) ! 27: int sz; ! 28: { ! 29: register char *p; ! 30: extern char *malloc(); ! 31: ! 32: p = malloc(sz); ! 33: if (p == NULL) ! 34: syserr("Out of memory"); ! 35: return (p); ! 36: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.