mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Don't push on the stack 200KB in one go
This could be a limit on some platforms (as it seems
to be in Native Client). Patch from a SF fork on github:
47374afd6f
No functional change.
This commit is contained in:
parent
ed0fb0b05f
commit
faaa1f1116
1 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,7 @@ uint32_t Bitbases::probe_kpk(Square wksq, Square wpsq, Square bksq, Color stm) {
|
||||||
|
|
||||||
void Bitbases::init_kpk() {
|
void Bitbases::init_kpk() {
|
||||||
|
|
||||||
Result db[IndexMax];
|
Result* db = new Result[IndexMax]; // Avoid to hit stack limit on some platforms
|
||||||
KPKPosition pos;
|
KPKPosition pos;
|
||||||
int idx, bit, repeat = 1;
|
int idx, bit, repeat = 1;
|
||||||
|
|
||||||
|
@ -90,6 +90,8 @@ void Bitbases::init_kpk() {
|
||||||
for (bit = 0; bit < 32; bit++)
|
for (bit = 0; bit < 32; bit++)
|
||||||
if (db[32 * idx + bit] == WIN)
|
if (db[32 * idx + bit] == WIN)
|
||||||
KPKBitbase[idx] |= 1 << bit;
|
KPKBitbase[idx] |= 1 << bit;
|
||||||
|
|
||||||
|
delete [] db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue