diff options
-rw-r--r-- | makefile | 2 | ||||
-rw-r--r-- | src/a5.c | 12 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/nt5.c | 2 |
4 files changed, 6 insertions, 12 deletions
@@ -55,7 +55,7 @@ ifneq ($(run),) run_cmd := @echo "run $(bin)" run_cmd += && cd bin run_cmd += && echo "----------------------------------------------------------------" - run_cmd += && time ./$(out_file) -a6 100000000 + run_cmd += && time ./$(out_file) -a5 100000000 run_cmd += ; echo "----------------------------------------------------------------" run_cmd += && cd .. endif @@ -19,21 +19,17 @@ static uint64_t *index; static uint64_t filled; void a5_init(uint64_t n){ - size_t lastp_size; + size_t index_n; size_t index_size; + size_t lastp_size; t = 0; filled = 0; - index_size = (n-1)/8+1; + index_n = (n-1)/64+1; + index_size = index_n*sizeof(uint64_t); lastp_size = n*sizeof(uint32_t); index = calloc(index_size,1); lastp = calloc(lastp_size,1); - /* - index = AALLOC(64,index_size); - lastp = AALLOC(64,lastp_size); - memset(index,0x00,index_size); - memset(lastp,0x00,lastp_size); - */ } void a5_loop(uint64_t x0,uint64_t x1){ @@ -65,7 +65,7 @@ int main(int argc,char **argv){ void (*calc)(uint64_t n); #ifdef _WIN32 - SetPriorityClass(GetCurrentProcess(),REALTIME_PRIORITY_CLASS); + SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); #endif calc = calc_fast; @@ -21,11 +21,9 @@ static unsigned int cont_filled; void nt5_init(uint64_t n){ size_t size = (n-1)/8+1+n*sizeof(unsigned int); - //size_t size = n/8+n*sizeof(unsigned int); temp = malloc(size); memset(temp, 0, size); index = (unsigned long long *)temp; - //lastpos = (unsigned int *)(&temp[n / 8]); lastpos = (unsigned int *)(&temp[(n-1)/8+1]); current = 0; cont_filled = 0; |