Skip to content

Commit

Permalink
Update search.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
dpldgr committed Nov 10, 2024
1 parent d5aecf3 commit 7251028
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ namespace {
}

// Reductions lookup table, initialized at startup
#ifdef USE_HEAP_INSTEAD_OF_STACK_FOR_MOVE_LIST
int* Reductions = 0;
#else
int Reductions[MAX_MOVES]; // [depth or moveNumber]
#endif
int Reductions[8192]; // [depth or moveNumber] // 8192 = maximum MAX_MOVES.

Depth reduction(bool i, Depth d, int mn) {
int r = Reductions[d] * Reductions[mn];
Expand Down Expand Up @@ -158,15 +154,6 @@ namespace {

void Search::init() {

#ifdef USE_HEAP_INSTEAD_OF_STACK_FOR_MOVE_LIST
Reductions = (int*)malloc(sizeof(int)*MAX_MOVES);
if (Reductions == 0)
{
printf("Error: Failed to allocate memory in heap.");
exit(1);
}
#endif

for (int i = 1; i < MAX_MOVES; ++i)
Reductions[i] = int(21.9 * std::log(i));
}
Expand Down

0 comments on commit 7251028

Please sign in to comment.