summaryrefslogtreecommitdiff
path: root/stringsort.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 /stringsort.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 'stringsort.c')
-rw-r--r--stringsort.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/stringsort.c b/stringsort.c
index ed8c913..b38f5bd 100644
--- a/stringsort.c
+++ b/stringsort.c
@@ -52,7 +52,6 @@ static void strsift(unsigned long *optrarray,
double
DoStringSort(void)
{
- const char* context = "CPU:String Sort";
unsigned char* array = NULL;
clock_t total_time = 0;
int iterations = 0;
@@ -72,10 +71,6 @@ DoStringSort(void)
** (this can happen during string adjustment)
*/
array = realloc(array, (ARRAY_SIZE + 100) * num_arrays);
- if (!array) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- exit(1);
- }
/*
** Do an iteration of the string sort. If the
@@ -90,10 +85,6 @@ DoStringSort(void)
** Simply allocate the space for the array.
*/
array = malloc((ARRAY_SIZE + 100) * num_arrays);
- if (!array) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- exit(1);
- }
}
do {
@@ -247,11 +238,6 @@ while(k<num_arrays)
** offset pointer array.
*/
optrarray = malloc(*nstrings * sizeof(unsigned long) * num_arrays);
-if (!optrarray) {
- /* FIXME: add error message */
- free(strarray);
- exit(1);
-}
/*
** Go through the newly-built string array, building