comparison gen_arm.c @ 792:724bbec47f86

Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
author Michael Pavone <pavone@retrodev.com>
date Sat, 25 Jul 2015 18:22:07 -0700
parents bff307e03a94
children
comparison
equal deleted inserted replaced
791:60686f8d5e48 792:724bbec47f86
74 { 74 {
75 if (code->cur == code->last) { 75 if (code->cur == code->last) {
76 size_t size = CODE_ALLOC_SIZE; 76 size_t size = CODE_ALLOC_SIZE;
77 uint32_t *next_code = alloc_code(&size); 77 uint32_t *next_code = alloc_code(&size);
78 if (!next_code) { 78 if (!next_code) {
79 fputs("Failed to allocate memory for generated code\n", stderr); 79 fatal_error("Failed to allocate memory for generated code\n");
80 exit(1);
81 } 80 }
82 if (next_code = code->last + RESERVE_WORDS) { 81 if (next_code = code->last + RESERVE_WORDS) {
83 //new chunk is contiguous with the current one 82 //new chunk is contiguous with the current one
84 code->last = next_code + size/sizeof(code_word) - RESERVE_WORDS; 83 code->last = next_code + size/sizeof(code_word) - RESERVE_WORDS;
85 } else { 84 } else {