home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / voglw.zip / valloc.c < prev    next >
C/C++ Source or Header  |  1997-02-13  |  332b  |  21 lines

  1. #include "vogl.h"
  2.  
  3. /*
  4.  * vallocate
  5.  *
  6.  *    Allocate some memory, barfing if malloc returns NULL.
  7.  */
  8. char *
  9. vallocate(size)
  10.     unsigned    size;
  11. {
  12.     char    *p, buf[60];
  13.  
  14.     if ((p = (char *)malloc(size)) == (char *)0) {
  15.         sprintf(buf,"vallocate: request for %d bytes returned NULL", size);
  16.         verror(buf);
  17.     }
  18.  
  19.     return (p);
  20. }
  21.