]> git.sesse.net Git - stockfish/commitdiff
Properly set to zero stuff returned by 'new'
authorMarco Costalba <mcostalba@gmail.com>
Thu, 7 Oct 2010 02:55:08 +0000 (03:55 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 7 Oct 2010 02:57:33 +0000 (03:57 +0100)
Language guarantees that c'tor is called, but without any c'tor
it happens to work by accident because OS zeroes out the freshly
allocated pages. The problem is that if I deallocate and allocate
again, the second time pages are no more newly come by the OS and
so could contain stale info.

A practical case could be if we change TT size or numbers of
threads on the fly while already running.

Bug spotted by Justin Blanchard.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

No differences found