|
@@ -19,6 +19,8 @@
|
|
|
* random seed: 1
|
|
|
*/
|
|
|
|
|
|
+#define _XOPEN_SOURCE 500
|
|
|
+
|
|
|
#include <pthread.h>
|
|
|
#include <stdio.h>
|
|
|
#include <sys/time.h>
|
|
@@ -158,9 +160,8 @@ static void * exercise_heap( void *pinput) {
|
|
|
|
|
|
volatile char * chptr = ((char *) pdea->array[victim]);
|
|
|
*chptr++ = 'a';
|
|
|
- volatile char ch = *((char *) pdea->array[victim]);
|
|
|
- ch = 'b';
|
|
|
-
|
|
|
+ volatile char ch __attribute__((unused)) = *((char *) pdea->array[victim]);
|
|
|
+ *chptr = 'b';
|
|
|
|
|
|
if( stopflag ) break;
|
|
|
}
|
|
@@ -201,7 +202,7 @@ static void runthreads(long sleep_cnt, int min_threads, int max_threads, int chp
|
|
|
QueryPerformanceFrequency( &ticks_per_sec );
|
|
|
|
|
|
pdea = &de_area[0];
|
|
|
- memset(&de_area[0], 0, sizeof(thread_data));
|
|
|
+ memset(pdea, 0, sizeof(thread_data));
|
|
|
|
|
|
prevthreads = 0 ;
|
|
|
for(num_threads=min_threads; num_threads <= max_threads; num_threads++) {
|