part2 ver 0.2.2

This commit is contained in:
ClF3 2024-11-04 20:06:23 +08:00
parent a5c6a2bd5f
commit 73dfe68cdf
1 changed files with 3 additions and 3 deletions

View File

@ -21,10 +21,10 @@ int main() {
clflush((ADDR_PTR)buf + i * 128); clflush((ADDR_PTR)buf + i * 128);
} }
for(int i = 0; i < WAIT_TIME; i++); for(int i = 0; i < WAIT_TIME; i++);
for(int i = 0; i < 1024; i++) { for(int i = 100; i < 10000; i++) {
time = measure_one_block_access_time((ADDR_PTR)buf + (i * 10020107) % 1024 * 128); time = measure_one_block_access_time((ADDR_PTR)buf + (i*i) / 1024 % 1024 * 128);
if(time < CACHE_HIT_THRESHOLD) { if(time < CACHE_HIT_THRESHOLD) {
flag = (i * 10020107) % 1024; flag = (i*i) / 1024 % 1024;
break; break;
} }
} }