}
-uint32_t probe_kpk_bitbase(Square wksq, Square wpsq, Square bksq, Color stm) {
+uint32_t Bitbases::probe_kpk(Square wksq, Square wpsq, Square bksq, Color stm) {
int idx = index(wksq, bksq, wpsq, stm);
return KPKBitbase[idx / 32] & (1 << (idx & 31));
}
-void kpk_bitbase_init() {
+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;
for (bit = 0; bit < 32; bit++)
if (db[32 * idx + bit] == WIN)
KPKBitbase[idx] |= 1 << bit;
+
+ delete [] db;
}