diff options
author | Matt Turner <mattst88@gmail.com> | 2008-11-17 20:43:00 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-11-17 20:43:00 +0000 |
commit | d064ec35868720e0f29c1fe53a6e688333e71736 (patch) | |
tree | 3662aad3e5a9b536de44a3d85a8720ea06812ba9 /linear.c | |
parent | 10a5d62de08035803b5fadc5fcd32c873f8b1702 (diff) |
Remove malloc return checks. Since they're in loops, they don't prevent memory from being leaked after the first iteration. Plus, when does malloc fail?
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@78 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'linear.c')
-rw-r--r-- | linear.c | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -65,7 +65,6 @@ static int lusolve(double a[][LUARRAYCOLS], double DoLU(void) { - const char* context = "FPU:LU"; clock_t total_time = 0; int iterations = 0; double* a = NULL; @@ -110,23 +109,8 @@ DoLU(void) ++num_arrays; abase = realloc(abase, sizeof(double) * LUARRAYCOLS * LUARRAYROWS * (num_arrays + 1)); - if (!abase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(a); - free(b); - free(LUtempvv); - exit(1); - } bbase = realloc(bbase, sizeof(double) * LUARRAYROWS * (num_arrays + 1)); - if (!bbase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(a); - free(b); - free(abase); - free(LUtempvv); - exit(1); - } } while ((DoLUIteration(a, b, abase, bbase, num_arrays) <= MINIMUM_TICKS) && (num_arrays <= ARRAY_MAX)); /* @@ -147,23 +131,8 @@ DoLU(void) ** number of arrays and proceed. */ abase = malloc(sizeof(double) * LUARRAYCOLS * LUARRAYROWS * num_arrays); - if (!abase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(a); - free(b); - free(LUtempvv); - exit(1); - } bbase = malloc(sizeof(double) * LUARRAYROWS * num_arrays); - if (!bbase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(a); - free(b); - free(abase); - free(LUtempvv); - exit(1); - } } do { |