Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /examples/util/util.c
ViewVC logotype

View of /examples/util/util.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (download) (as text) (annotate)
Tue Oct 27 15:16:36 2015 UTC (6 years, 1 month ago) by jhr
File size: 534 byte(s)
making copyrights consistent for all code in the repository
/*! \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 <stdio.h>

/* 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;
}

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0