home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / gutil / xalloc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-01-23  |  550 b   |  37 lines

  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. }
  37.