From: Marco Costalba Date: Sun, 30 Sep 2012 09:32:42 +0000 (+0200) Subject: Don't push on the stack 200KB in one go X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=faaa1f11164f350427a6950b2ea75a646e3e87c8;ds=sidebyside 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: https://github.com/ccherng/Stockfish/commit/47374afd6fdfabd9de183a7a67d645daad45fb21 No functional change. --- diff --git a/src/bitbase.cpp b/src/bitbase.cpp index fdfb207b..5f0438a3 100644 --- a/src/bitbase.cpp +++ b/src/bitbase.cpp @@ -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; }