Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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:

ccherng@47374af

No functional change.
  • Loading branch information...
commit faaa1f11164f350427a6950b2ea75a646e3e87c8 1 parent ed0fb0b
Marco Costalba authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/bitbase.cpp
4 src/bitbase.cpp
View
@@ -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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.