From ff10afd2265ab87e5677287691e75711a9883eb5 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 18 May 2020 15:11:24 -0700 Subject: [PATCH] remove thread dependency in symbol.cpp on single thread #4382 Signed-off-by: Nikolaj Bjorner --- src/util/symbol.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/util/symbol.cpp b/src/util/symbol.cpp index 042d6292d..4516001c7 100644 --- a/src/util/symbol.cpp +++ b/src/util/symbol.cpp @@ -16,10 +16,6 @@ Author: Revision History: --*/ -#if 0 - - // include "util/new_symbol.cpp" -#else #include "util/symbol.h" #include "util/mutex.h" @@ -27,7 +23,9 @@ Revision History: #include "util/region.h" #include "util/string_buffer.h" #include +#ifdef SINGLE_THREAD #include +#endif @@ -103,7 +101,11 @@ static internal_symbol_tables* g_symbol_tables = nullptr; void initialize_symbols() { if (!g_symbol_tables) { +#ifdef SINGLE_THREAD + unsigned num_tables = 1; +#else unsigned num_tables = 2 * std::min((unsigned) std::thread::hardware_concurrency(), 64u); +#endif g_symbol_tables = alloc(internal_symbol_tables, num_tables); } @@ -190,4 +192,3 @@ bool lt(symbol const & s1, symbol const & s2) { return cmp < 0; } -#endif