Let material probing to access per-thread table

It is up to material (and pawn) table look up
code to know where the per-thread tables are,
so change API to reflect this.

Also some comment fixing while there

No functional change.
This commit is contained in:
Marco Costalba
2014-12-30 10:31:50 +01:00
parent 19b8249ff4
commit 91cc82aa25
10 changed files with 66 additions and 66 deletions

View File

@@ -24,6 +24,7 @@
#include "bitcount.h"
#include "pawns.h"
#include "position.h"
#include "thread.h"
namespace {
@@ -202,9 +203,9 @@ namespace {
namespace Pawns {
/// init() initializes some tables used by evaluation. Instead of hard-coded
/// tables, when makes sense, we prefer to calculate them with a formula to
/// reduce independent parameters and to allow easier tuning and better insight.
/// Pawns::init() initializes some tables needed by evaluation. Instead of using
/// hard-coded tables, when makes sense, we prefer to calculate them with a formula
/// to reduce independent parameters and to allow easier tuning and better insight.
void init()
{
@@ -220,14 +221,15 @@ void init()
}
/// probe() takes a position as input, computes a Entry object, and returns a
/// pointer to it. The result is also stored in a hash table, so we don't have
/// to recompute everything when the same pawn structure occurs again.
/// Pawns::probe() looks up the current position's pawns configuration in
/// the pawns hash table. It returns a pointer to the Entry if the position
/// is found. Otherwise a new Entry is computed and stored there, so we don't
/// have to recompute all when the same pawns configuration occurs again.
Entry* probe(const Position& pos, Table& entries) {
Entry* probe(const Position& pos) {
Key key = pos.pawn_key();
Entry* e = entries[key];
Entry* e = pos.this_thread()->pawnsTable[key];
if (e->key == key)
return e;