From: Marco Costalba Date: Sat, 23 Jul 2011 11:52:49 +0000 (+0100) Subject: Use a circular buffer to keep track of setup states X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=5f7eb20090ccd04b2a7d439b723ed58591dcc7e8;hp=5f7eb20090ccd04b2a7d439b723ed58591dcc7e8 Use a circular buffer to keep track of setup states This fixes a regression on real games due to the fact that we have some mismatches: history[st->gamePly - i] != stp->key when st->gamePly - i == 0,this is due to a nasty bug I have introduced when using std::vector<> as StateInfo backup. The point is that StateInfo keeps inside a pointer to the previous StateInfo in a kind of linked list. But when std::vector<> is resized reallocates a larger chunk of memory and moves the data there so these pointers became stale. This patch fixes the issue. No functional change. Signed-off-by: Marco Costalba ---