/*****************************************************************************/ /* */ /* UNIT: NTL0_ckalloc (Level 0 library routine) */ /* */ /* Author: Nikola Stojanovic */ /* */ /* Revision: 27 JUN 94 Version 1.0 */ /* */ /* Function: */ /* */ /* Procedure allocates the requested amount of memory space and returns */ /* pointer to it, if allocation was successful; if it was unsuccessful, */ /* causes program exit, so it never returns NULL */ /* */ /*****************************************************************************/ #include #include #include "ntl0.h" /*****************************************************************************/ char *NTL0_ckalloc (long int amount) { char *storage; if ((storage = (char *) malloc ((unsigned) amount)) == NULL) { fprintf (stderr, "Ran out of memory."); exit (1); /* Terminate program */ } else return storage; }