mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08: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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user