Merge remote-tracking branch 'upstream/master' into issue2004
commit001fb4a34f9a4ff9e85ec3c264ad02e00734c47b
authorAndreas Reuleaux <arx@a-rx.info>
dateThu 19 Mar 2015, 18:37 (12 years ago)
parentd0310fd446d99d
rts/idris_gc.c+8
@@ -115,6 +115,14 @@ void idris_gc(VM* vm) {
115115 char* newheap = malloc(vm->heap.size);
116116 char* oldheap = vm->heap.heap;
117117
118+ if (newheap == NULL) {
119+ fprintf(stderr,
120+ "GC ERROR: Unable to allocate new heap. Requested %zd bytes.\n",
121+ vm->heap.size);
122+
123+ exit(EXIT_FAILURE);
124+ }
125+
118126 vm->heap.heap = newheap;
119127#ifdef FORCE_ALIGNMENT
120128 if (((i_int)(vm->heap.heap)&1) == 1) {