summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2020-04-09 17:11:50 +0200
committerjonsykkel <jonrevold@gmail.com>2020-04-09 17:11:50 +0200
commitcc35247693429e99ee256f68879fcab7a6daaf27 (patch)
tree7447ba2443a5b81841597021cbc965c7d1730d23
parentaab7766f0bc045b6859c2d9a96f6b13bcfe75fd6 (diff)
downloadct_sequence-cc35247693429e99ee256f68879fcab7a6daaf27.tar.gz
vork
-rw-r--r--makefile2
-rw-r--r--src/a5.c12
-rw-r--r--src/main.c2
-rw-r--r--src/nt5.c2
4 files changed, 6 insertions, 12 deletions
diff --git a/makefile b/makefile
index fff6a5a..b8fa6a6 100644
--- a/makefile
+++ b/makefile
@@ -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
diff --git a/src/a5.c b/src/a5.c
index 46ddcfd..004cab6 100644
--- a/src/a5.c
+++ b/src/a5.c
@@ -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){
diff --git a/src/main.c b/src/main.c
index 9beefbd..2ee8195 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
diff --git a/src/nt5.c b/src/nt5.c
index 8cb558e..b00d918 100644
--- a/src/nt5.c
+++ b/src/nt5.c
@@ -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;