summaryrefslogtreecommitdiff
path: root/numsort.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-17 20:43:00 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-17 20:43:00 +0000
commitd064ec35868720e0f29c1fe53a6e688333e71736 (patch)
tree3662aad3e5a9b536de44a3d85a8720ea06812ba9 /numsort.c
parent10a5d62de08035803b5fadc5fcd32c873f8b1702 (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 'numsort.c')
-rw-r--r--numsort.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/numsort.c b/numsort.c
index a81e051..a9759d0 100644
--- a/numsort.c
+++ b/numsort.c
@@ -38,7 +38,6 @@ static void NumSift(long *array, unsigned long min, unsigned long max);
double
DoNumSort (void)
{
- const char* context = "CPU:Numeric Sort";
long* array = NULL;
clock_t total_time = 0;
int iterations = 0;
@@ -58,10 +57,6 @@ DoNumSort (void)
++num_arrays;
array = realloc(array, num_arrays * ARRAY_SIZE * sizeof(long));
- if (!array) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- exit(1);
- }
/*
** Do an iteration of the numeric sort. If the
@@ -72,10 +67,6 @@ DoNumSort (void)
} while (DoNumSortIteration(array, num_arrays) <= MINIMUM_TICKS);
} else {
array = malloc(num_arrays * ARRAY_SIZE * sizeof(long));
- if (!array) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- exit(1);
- }
}
/*