00001 /* rr_malloc(): call malloc and quit if it fails */ 00002 /*===================================================================== 00003 ======= COPYRIGHT NOTICE ======= 00004 Copyright (C) 1994, Carnegie Mellon University and Ronald Rosenfeld. 00005 All rights reserved. 00006 00007 This software is made available for research purposes only. It may be 00008 redistributed freely for this purpose, in full or in part, provided 00009 that this entire copyright notice is included on any copies of this 00010 software and applications and derivations thereof. 00011 00012 This software is provided on an "as is" basis, without warranty of any 00013 kind, either expressed or implied, as to any matter including, but not 00014 limited to warranty of fitness of purpose, or merchantability, or 00015 results obtained from use of this software. 00016 ======================================================================*/ 00017 00018 /* 8/93: if 0 bytes requested, allocate 1 anyway, to placate the alphas during 00019 address computations */ 00020 00021 /* need to include stdlib to prevent warnings at compilation time, 00022 Philip Clarkson, March 1997 */ 00023 00024 #include <stdlib.h> 00025 00026 #include "general.h" 00027 00031 char *rr_malloc(size_t n_bytes) 00032 { 00033 char *result; 00034 result = (char *) malloc(MAX(n_bytes,1)); 00035 if (! result) quit(-1,"rr_malloc: could not allocate %d bytes\n",n_bytes); 00036 return(result); 00037 }