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

SCM Repository

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

Annotation of /examples/util/util.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1884 - (view) (download) (as text)

1 : jhr 1884 /*! \file util.c
2 :     *
3 :     * \brief This file contains various utility functions.
4 :     *
5 :     * \author John Reppy
6 :     */
7 :    
8 :     /*
9 :     * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
10 :     * All rights reserved.
11 :     */
12 :    
13 :     #include "util.h"
14 :     #include <stdio.h>
15 :    
16 :     /* CheckMalloc:
17 :     */
18 :     void *CheckMalloc (size_t nbytes)
19 :     {
20 :     void *obj = malloc(nbytes);
21 :     if (obj == 0) {
22 :     fprintf(stderr, "Fatel error: unable to allocate %d bytes\n", (int)nbytes);
23 :     exit (1);
24 :     }
25 :    
26 :     return obj;
27 :     }

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