Fix wrong bucket_size bug

This commit is contained in:
unkernet
2017-08-28 02:14:36 +03:00
parent a9410a1b30
commit db69999219

View File

@ -136,11 +136,13 @@ inline uint64_t crack_states_bitsliced(uint32_t **task){
}
}
#ifdef EXACT_COUNT
// Fix a "1000000% bug". Looks like here is a problem with OS X gcc
bucket_states_tested += bucket_size[block_idx] > MAX_BITSLICES ? MAX_BITSLICES : bucket_size[block_idx];
size_t current_bucket_size = bucket_size[block_idx] > MAX_BITSLICES ? MAX_BITSLICES : bucket_size[block_idx];
#ifdef EXACT_COUNT
bucket_states_tested += current_bucket_size;
#ifdef ONLINE_COUNT
__atomic_fetch_add(&total_states_tested, bucket_size[block_idx] > MAX_BITSLICES ? MAX_BITSLICES : bucket_size[block_idx], __ATOMIC_RELAXED);
__atomic_fetch_add(&total_states_tested, current_bucket_size, __ATOMIC_RELAXED);
#endif
#else
#ifdef ONLINE_COUNT