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 /bitfield.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 'bitfield.c')
-rw-r--r-- | bitfield.c | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -42,7 +42,6 @@ static void FlipBitRun(unsigned long *bitmap, double DoBitops(void) { - const char* context = "CPU:Bitfields"; unsigned long* bitarray = NULL; unsigned long* bitoparray = NULL; clock_t total_time = 0; @@ -55,20 +54,11 @@ DoBitops(void) is_adjusted = true; bitarray = realloc(bitarray, ARRAY_SIZE * sizeof(unsigned long)); - if (!bitarray) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - exit(1); - } do { bitop_array_size += 100; bitoparray = malloc(bitop_array_size * 2 * sizeof(unsigned long)); - if (!bitoparray) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(bitarray); - exit(1); - } /* ** Do an iteration of the bitmap test. If the @@ -83,17 +73,8 @@ DoBitops(void) ** the array space. */ bitarray = malloc(ARRAY_SIZE * sizeof(unsigned long)); - if (!bitarray) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - exit(1); - } bitoparray = malloc(bitop_array_size * 2 * sizeof(unsigned long)); - if (!bitoparray) { - fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context); - free(bitarray); - exit(1); - } } /* |