/*! \file util.c * * \brief This file contains various utility functions. * * \author John Reppy */ /* * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu) * * COPYRIGHT (c) 2015 The University of Chicago * All rights reserved. */ #include "util.h" #include /* CheckMalloc: */ void *CheckMalloc (size_t nbytes) { void *obj = malloc(nbytes); if (obj == 0) { fprintf(stderr, "Fatel error: unable to allocate %d bytes\n", (int)nbytes); exit (1); } return obj; }
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: err, "Fatel error: unable to allocate %d bytes\n", (int)nbytes); exit (1); } return obj; }