1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +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:
Marco Costalba 2012-09-30 11:32:42 +02:00
parent ed0fb0b05f
commit faaa1f1116

View file

@ -71,7 +71,7 @@ uint32_t Bitbases::probe_kpk(Square wksq, Square wpsq, Square bksq, Color stm) {
void Bitbases::init_kpk() {
Result db[IndexMax];
Result* db = new Result[IndexMax]; // Avoid to hit stack limit on some platforms
KPKPosition pos;
int idx, bit, repeat = 1;
@ -90,6 +90,8 @@ void Bitbases::init_kpk() {
for (bit = 0; bit < 32; bit++)
if (db[32 * idx + bit] == WIN)
KPKBitbase[idx] |= 1 << bit;
delete [] db;
}