Main Page | Data Structures | File List | Data Fields | Globals

/home/kevin/Documents/PYLikeC/utility.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include "utility.h"
00004 
00005 /**********
00006  * Memory *
00007  **********/
00008 
00009 void *xmalloc (size_t size)
00010 {
00011    register void *value = malloc (size);
00012    if (value == 0)
00013      {
00014         puts("\n\nvirtual memory exhausted!!!\n\n");
00015         fflush(stdout);
00016         exit(8);
00017      }
00018    return value;  
00019 }
00020 
00021 void *xrealloc (void *ptr, size_t size)
00022 {
00023    register void *value = realloc (ptr, size);
00024    if (value == 0)
00025      {
00026         puts("\n\nvirtual memory exhausted!!!\n\n");
00027         fflush(stdout);
00028         exit(8);
00029      } 
00030    return value;
00031 }
00032 
00033 

Generated on Thu Mar 3 11:45:32 2005 for spga by  doxygen 1.3.9.1