Skip to content

Commit

Permalink
Increase per thread stack size
Browse files Browse the repository at this point in the history
When using musl libc the default statck size is too small for the scrypt
code that uses alloca.

see: luke-jr#723
  • Loading branch information
TheBiggerGuy committed Oct 20, 2017
1 parent 43defc1 commit e033bc3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -12609,9 +12609,17 @@ void start_cgpu(struct cgpu_info *cgpu)

thread_reportout(thr);

if (unlikely(thr_info_create(thr, NULL, miner_thread, thr)))
pthread_attr_t attr;
if (unlikely(pthread_attr_init(&attr)))
quit(1, "thread %d create failed (init)", thr->id);
if (unlikely(pthread_attr_setstacksize(&attr, (size_t) 2 << 20)))
quit(1, "thread %d create failed (set statck size)", thr->id);

if (unlikely(thr_info_create(thr, &attr, miner_thread, thr)))
quit(1, "thread %d create failed", thr->id);

pthread_attr_destroy(&attr);

notifier_wake(thr->notifier);
}
if (cgpu->deven == DEV_ENABLED)
Expand Down

0 comments on commit e033bc3

Please sign in to comment.