|
@@ -30,7 +30,7 @@ typedef struct thr_data {
|
|
|
int max_size;
|
|
|
|
|
|
char **array;
|
|
|
- int *blksize;
|
|
|
+ long *blksize;
|
|
|
int asize;
|
|
|
|
|
|
int cAllocs;
|
|
@@ -47,16 +47,15 @@ int volatile stopflag = FALSE;
|
|
|
int min_size = 10, max_size = 500;
|
|
|
struct lran2_st rgen;
|
|
|
char *blkp[MAX_BLOCKS];
|
|
|
-int blksize[MAX_BLOCKS];
|
|
|
+long blksize[MAX_BLOCKS];
|
|
|
|
|
|
static void QueryPerformanceFrequency(long *x) {
|
|
|
*x = 1000000L;
|
|
|
}
|
|
|
|
|
|
static void QueryPerformanceCounter (long *x) {
|
|
|
- struct timezone tz;
|
|
|
struct timeval tv;
|
|
|
- gettimeofday(&tv, &tz);
|
|
|
+ gettimeofday(&tv, NULL);
|
|
|
*x = tv.tv_sec * 1000000L + tv.tv_usec;
|
|
|
}
|
|
|
|
|
@@ -76,8 +75,8 @@ static void _beginthread(VoidFunction x, void * z) {
|
|
|
|
|
|
static void warmup(char **blkp, int num_chunks) {
|
|
|
int cblks;
|
|
|
- int victim;
|
|
|
- int blk_size;
|
|
|
+ long victim;
|
|
|
+ long blk_size;
|
|
|
LPVOID tmp;
|
|
|
|
|
|
for(cblks = 0; cblks < num_chunks; cblks++) {
|
|
@@ -109,7 +108,7 @@ static void warmup(char **blkp, int num_chunks) {
|
|
|
static void * exercise_heap( void *pinput) {
|
|
|
thread_data *pdea;
|
|
|
int cblks = 0;
|
|
|
- int victim;
|
|
|
+ long victim;
|
|
|
long blk_size;
|
|
|
int range;
|
|
|
|
|
@@ -234,7 +233,7 @@ static void runthreads(long sleep_cnt, int min_threads, int max_threads, int chp
|
|
|
}
|
|
|
|
|
|
ticks = end_cnt - start_cnt ;
|
|
|
- duration = (double)ticks/ticks_per_sec ;
|
|
|
+ duration = (double)(ticks/ticks_per_sec);
|
|
|
|
|
|
for(i = 0; i < num_threads; i++) {
|
|
|
if( !de_area[i].finished ) {
|
|
@@ -254,7 +253,7 @@ static void runthreads(long sleep_cnt, int min_threads, int max_threads, int chp
|
|
|
printf("%6.3f", duration ) ;
|
|
|
printf("%6.3f", rate_n/rate_1 ) ;
|
|
|
printf("%8.0f", sum_allocs/duration ) ;
|
|
|
- printf(" %6.3f %.3f", (double)used_space/(1024*1024), used_space/reqd_space) ;
|
|
|
+ printf(" %6.3f %.3f", (double)(used_space/(1024*1024)), (used_space/reqd_space)
|
|
|
printf("\n") ;
|
|
|
|
|
|
Sleep(5000L) ; // wait 5 sec for old threads to die
|