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 /fourier.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 'fourier.c')
-rw-r--r-- | fourier.c | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -43,7 +43,6 @@ static double thefunction(double x, double DoFourier(void) { - const char* context = "FPU:Transcendental"; double* abase = NULL; double* bbase = NULL; clock_t total_time = 0; @@ -58,17 +57,8 @@ DoFourier(void) array_size += 50; abase = realloc(abase, array_size * sizeof(double)); - if (!abase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - exit(1); - } bbase = realloc(bbase, array_size * sizeof(double)); - if (!bbase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(abase); - exit(1); - } /* ** Do an iteration of the tests. If the elapsed time is @@ -82,17 +72,8 @@ DoFourier(void) ** arrays, and go. */ abase = malloc(array_size * sizeof(double)); - if (!abase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - exit(1); - } bbase = malloc(array_size * sizeof(double)); - if (!bbase) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(abase); - exit(1); - } } do { |