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 --- assignment.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'assignment.c') diff --git a/assignment.c b/assignment.c index cf0edf7..17f8871 100644 --- a/assignment.c +++ b/assignment.c @@ -70,7 +70,6 @@ static void second_assignments(long tableau[][ASSIGNCOLS], double DoAssign(void) { - const char* context = "CPU:Assignment"; long* array = NULL; clock_t total_time = 0; int iterations = 0; @@ -89,11 +88,6 @@ DoAssign(void) ++num_arrays; array = realloc(array, sizeof(long) * ASSIGNROWS * ASSIGNCOLS * num_arrays); - if (!array) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - exit(1); - } - /* ** Do an iteration of the assignment alg. If the ** elapsed time is less than or equal to the permitted @@ -103,10 +97,6 @@ DoAssign(void) } while (DoAssignIteration(array, num_arrays) <= MINIMUM_TICKS); } else { array = malloc(sizeof(long) * ASSIGNROWS * ASSIGNCOLS * num_arrays); - if (!array) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - exit(1); - } } do { -- cgit v1.2.3