From 7251028d91cd8faef0f33bf246a205107d2b3e8c Mon Sep 17 00:00:00 2001 From: dpldgr <144766863+dpldgr@users.noreply.github.com> Date: Sun, 10 Nov 2024 14:23:31 +0800 Subject: [PATCH] Update search.cpp --- src/search.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 38465424e..f1f3b1988 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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]; @@ -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)); }