luke-jr/bfgminer — pull request #168 by jaketri (2012-10-16 05:00:18+00:00)
Title: Fix for issue #167 / BFGMiner crash with access violation

This is a fix for issue #167

First, the access violation was cause by line #721 from ocl.c where "numbuf" was to small for any thread-concurrency > 9999. To fix it I just increased the size of numbuf from 10 chars to 32.
Another possible way to fix it is to split the operation from lines #721-722 into 2 , first process lookup_gap then thread_concurrency.

After that I was able to use thread_concurrency up to 16384. For more memory allocation for padbuffer8 buffer failed. Failure is due to logic that supposed to find the smallest power of 2 value >= required amount of memory. Old logic works fine only if board have memory size a power of 2. The new logic just find the smallest power of 2 value and if it is small enough (less than board memory size) it use it.