From d064ec35868720e0f29c1fe53a6e688333e71736 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 17 Nov 2008 20:43:00 +0000 Subject: 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 --- fourier.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'fourier.c') diff --git a/fourier.c b/fourier.c index a031365..f7b0146 100644 --- a/fourier.c +++ b/fourier.c @@ -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 { -- cgit v1.2.3