home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / MemPanic.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-22  |  1.5 KB  |  52 lines

  1. /* 
  2.  * MemPanic.c --
  3.  *
  4.  *    Source code for the "MemPanic" procedure, which is used
  5.  *    internally by the memory allocator to die gracefully after
  6.  *    an unrecoverable error.  Different programs or uses of the
  7.  *    allocator may replace this procedure with something more
  8.  *    suitable for the particular program or use.
  9.  *
  10.  * Copyright 1985, 1988 Regents of the University of California
  11.  * Permission to use, copy, modify, and distribute this
  12.  * software and its documentation for any purpose and without
  13.  * fee is hereby granted, provided that the above copyright
  14.  * notice appear in all copies.  The University of California
  15.  * makes no representations about the suitability of this
  16.  * software for any purpose.  It is provided "as is" without
  17.  * express or implied warranty.
  18.  */
  19.  
  20. #ifndef lint
  21. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/MemPanic.c,v 1.2 88/06/17 18:07:00 ouster Exp $ SPRITE (Berkeley)";
  22. #endif not lint
  23.  
  24. #include <sprite.h>
  25. #include <sys.h>
  26.  
  27. /*
  28.  *----------------------------------------------------------------------
  29.  *
  30.  * MemPanic --
  31.  *
  32.  *    MemPanic is a procedure that's called by the memory allocator
  33.  *    when it has uncovered a fatal error.  MemPanic prints the 
  34.  *    message and aborts.  It does NOT return.
  35.  *
  36.  * Results:
  37.  *    None.
  38.  *
  39.  * Side effects:
  40.  *    The program is exited.
  41.  *
  42.  *----------------------------------------------------------------------
  43.  */
  44.  
  45. void
  46. MemPanic(message)
  47.     char *message;
  48. {
  49.     Sys_Panic(SYS_FATAL, "MemPanic: %s\n", message);
  50.     exit(1);
  51. }
  52.