print a better error message
authorbdemsky <bdemsky>
Wed, 19 Nov 2008 06:07:52 +0000 (06:07 +0000)
committerbdemsky <bdemsky>
Wed, 19 Nov 2008 06:07:52 +0000 (06:07 +0000)
Robust/src/Runtime/garbage.c

index 9684923dc3928672dd04efd23c0ebc282b0ce494..5fab5b8a7604becdf089fd6c4ed4b03f3949a085 100644 (file)
@@ -509,6 +509,10 @@ void * mygcmalloc(struct garbagelist * stackptr, int size) {
       if (last_heapsize>to_heapsize) {
        free(to_heapbase);
        to_heapbase=malloc(last_heapsize);
+       if (to_heapbase==NULL) {
+         printf("Error Allocating enough memory\n");
+         exit(-1);
+       }
        to_heaptop=to_heapbase+last_heapsize;
        to_heapptr=to_heapbase;
       }