mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Using less heap space as my TP-Link seems to not handle this much
This commit is contained in:
parent
5f5e1063f4
commit
b29edd111d
@ -197,13 +197,6 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
|
|
||||||
overflow = false;
|
overflow = false;
|
||||||
|
|
||||||
// Because we may have more than one solution on 1.15y boards, lets allocate space for these
|
|
||||||
for (i=0; i<GOLDEN_BACKLOG; i++)
|
|
||||||
hdata[i].goldenNonce = (uint32_t*)malloc((sizeof(uint32_t))*(ztex->extraSolutions+1));
|
|
||||||
if (hdata[i].goldenNonce == NULL) {
|
|
||||||
applog(LOG_ERR, "%s: failed to allocate hash_data.goldenNonce[%d]", ztex->repr, ztex->extraSolutions+1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
applog(LOG_DEBUG, "%s: entering poll loop", ztex->repr);
|
applog(LOG_DEBUG, "%s: entering poll loop", ztex->repr);
|
||||||
while (!(overflow || work_restart[thr->id].restart)) {
|
while (!(overflow || work_restart[thr->id].restart)) {
|
||||||
usleep(250000);
|
usleep(250000);
|
||||||
@ -222,8 +215,6 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
// And there's nothing we can do about it
|
// And there's nothing we can do about it
|
||||||
ztex_disable(thr);
|
ztex_disable(thr);
|
||||||
applog(LOG_ERR, "%s: Failed to read hash data with err %d, giving up", ztex->repr, i);
|
applog(LOG_ERR, "%s: Failed to read hash data with err %d, giving up", ztex->repr, i);
|
||||||
for (j=0; j<GOLDEN_BACKLOG; j++)
|
|
||||||
free(hdata[j].goldenNonce);
|
|
||||||
free(lastnonce);
|
free(lastnonce);
|
||||||
free(backlog);
|
free(backlog);
|
||||||
return 0;
|
return 0;
|
||||||
@ -292,8 +283,6 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
|
|
||||||
if (!ztex_updateFreq(ztex)) {
|
if (!ztex_updateFreq(ztex)) {
|
||||||
// Something really serious happened, so mark this thread as dead!
|
// Something really serious happened, so mark this thread as dead!
|
||||||
for (i=0; i<GOLDEN_BACKLOG; i++)
|
|
||||||
free(hdata[i].goldenNonce);
|
|
||||||
free(lastnonce);
|
free(lastnonce);
|
||||||
free(backlog);
|
free(backlog);
|
||||||
|
|
||||||
@ -304,8 +293,6 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
|
|
||||||
work->blk.nonce = 0xffffffff;
|
work->blk.nonce = 0xffffffff;
|
||||||
|
|
||||||
for (i=0; i<GOLDEN_BACKLOG; i++)
|
|
||||||
free(hdata[i].goldenNonce);
|
|
||||||
free(lastnonce);
|
free(lastnonce);
|
||||||
free(backlog);
|
free(backlog);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user