]> git.sesse.net Git - stockfish/commit
Reduce stack usage
authorMarco Costalba <mcostalba@gmail.com>
Sun, 8 Apr 2012 07:16:37 +0000 (08:16 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 8 Apr 2012 07:46:04 +0000 (08:46 +0100)
commit0049d3f337b6f3a66a06503c808d6d8b03b68505
tree7389447a17c656f6cde37604915256fb1ba8d483
parente0cae4bef8031a709c93eed1eb2754aa8ad806f0
Reduce stack usage

Shrink dimensions of the biggest stack consumers arrays.
In particular movesSearched[] can be safely shrinked
without any impact on strenght or risk of crashing.
Also MAX_PLY can be reverted to 100 with almost no impact
so to limit search recursion and hence stack allocation.

A different case is for MAX_MOVES (used by Movepicker's
moves[]), because we know that do exsist some artificial
position with about 220 legal moves, so in those cases SF
will crash. Anyhow these cases are never found in games.
An open risk remains perft, especially run above handcrafted
positions.

This patch originates from a report by Daylen that found
SF crashing on his Mac OS X 10.7.3 while in deep analysys
on the following position:

8/3Q1pk1/5p2/4r3/5K2/8/8/8 w - - 0 1

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp
src/types.h