mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Use only 2 queued work arrays in avalon.
This commit is contained in:
parent
afd6f42703
commit
0ea9d68d67
@ -654,7 +654,7 @@ static bool avalon_prepare(struct thr_info *thr)
|
|||||||
struct timeval now;
|
struct timeval now;
|
||||||
|
|
||||||
free(avalon->works);
|
free(avalon->works);
|
||||||
avalon->works = calloc(info->miner_count * sizeof(struct work *), 4);
|
avalon->works = calloc(info->miner_count * sizeof(struct work *), 2);
|
||||||
if (!avalon->works)
|
if (!avalon->works)
|
||||||
quit(1, "Failed to calloc avalon works in avalon_prepare");
|
quit(1, "Failed to calloc avalon works in avalon_prepare");
|
||||||
if (avalon->device_fd == -1)
|
if (avalon->device_fd == -1)
|
||||||
@ -681,7 +681,7 @@ static void avalon_free_work(struct thr_info *thr)
|
|||||||
works = avalon->works;
|
works = avalon->works;
|
||||||
info = avalon_infos[avalon->device_id];
|
info = avalon_infos[avalon->device_id];
|
||||||
|
|
||||||
for (i = 0; i < info->miner_count * 4; i++) {
|
for (i = 0; i < info->miner_count * 2; i++) {
|
||||||
if (works[i]) {
|
if (works[i]) {
|
||||||
work_completed(avalon, works[i]);
|
work_completed(avalon, works[i]);
|
||||||
works[i] = NULL;
|
works[i] = NULL;
|
||||||
@ -701,8 +701,7 @@ static void avalon_free_work_array(struct thr_info *thr)
|
|||||||
return;
|
return;
|
||||||
works = avalon->works;
|
works = avalon->works;
|
||||||
mc = avalon_infos[avalon->device_id]->miner_count;
|
mc = avalon_infos[avalon->device_id]->miner_count;
|
||||||
if (++avalon->work_array > 3)
|
avalon->work_array ^= 1;
|
||||||
avalon->work_array = 0;
|
|
||||||
|
|
||||||
for (i = avalon->work_array * mc, j = 0; j < mc; i++, j++) {
|
for (i = avalon->work_array * mc, j = 0; j < mc; i++, j++) {
|
||||||
if (likely(works[i])) {
|
if (likely(works[i])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user