1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Benchmark incorrect work size

This commit is contained in:
Kano 2012-12-12 19:52:36 +11:00
parent d3aed9fe90
commit 43e8b88a73

View File

@ -2657,10 +2657,10 @@ static void get_benchmark_work(struct work *work)
// Use a random work block pulled from a pool // Use a random work block pulled from a pool
static uint8_t bench_block[] = { CGMINER_BENCHMARK_BLOCK }; static uint8_t bench_block[] = { CGMINER_BENCHMARK_BLOCK };
size_t bench_size = sizeof(work); size_t bench_size = sizeof(*work);
size_t work_size = sizeof(bench_block); size_t work_size = sizeof(bench_block);
size_t min_size = (work_size < bench_size ? work_size : bench_size); size_t min_size = (work_size < bench_size ? work_size : bench_size);
memset(work, 0, sizeof(work)); memset(work, 0, sizeof(*work));
memcpy(work, &bench_block, min_size); memcpy(work, &bench_block, min_size);
work->mandatory = true; work->mandatory = true;
work->pool = pools[0]; work->pool = pools[0];