X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitbase.cpp;h=5f0438a3846c4bbd58a0136c41ff9db24d888b82;hp=9d2cde030754d48799ab40bed23fc68b7751486e;hb=98cd8239cc351f337132bb8cf08be728580c078d;hpb=6b5322ce000d6a8a6f845beda2d7e149e1baea0c diff --git a/src/bitbase.cpp b/src/bitbase.cpp index 9d2cde03..5f0438a3 100644 --- a/src/bitbase.cpp +++ b/src/bitbase.cpp @@ -62,16 +62,16 @@ namespace { } -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; @@ -90,6 +90,8 @@ void kpk_bitbase_init() { for (bit = 0; bit < 32; bit++) if (db[32 * idx + bit] == WIN) KPKBitbase[idx] |= 1 << bit; + + delete [] db; }