diff options
author | Anna Wawrzyniak <anna.wawrzyniak@mongodb.com> | 2023-01-09 22:39:17 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-10 00:00:09 +0000 |
commit | ef7b15f2dfd5953904c8e142fea65db2f250f9a4 (patch) | |
tree | 9d05b069459609b3d8d49577a9af1077f43667cb /src/mongo/db/exec/sbe | |
parent | 04d0423767ad5a845805e4ba37cbcd68648bb516 (diff) | |
download | mongo-ef7b15f2dfd5953904c8e142fea65db2f250f9a4.tar.gz |
SERVER-72326 Remove boost::format from SBE pretty printers due to TSAN race conditionshinyee.tan/local
Diffstat (limited to 'src/mongo/db/exec/sbe')
-rw-r--r-- | src/mongo/db/exec/sbe/values/value_printer.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/exec/sbe/vm/vm_printer.cpp | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/exec/sbe/values/value_printer.cpp b/src/mongo/db/exec/sbe/values/value_printer.cpp index 9673d20a304..4cd70a9196b 100644 --- a/src/mongo/db/exec/sbe/values/value_printer.cpp +++ b/src/mongo/db/exec/sbe/values/value_printer.cpp @@ -27,7 +27,6 @@ * it in the license file. */ #include <algorithm> -#include <boost/format.hpp> #include "mongo/db/exec/sbe/values/makeobj_spec.h" #include "mongo/db/exec/sbe/values/sort_spec.h" @@ -334,7 +333,7 @@ template <typename T> void ValuePrinter<T>::writeNormalizedDouble(double value) { std::stringstream ss; ss.precision(std::numeric_limits<double>::max_digits10); - ss << (boost::format("%f") % value); + ss << value; stream << ss.str(); } diff --git a/src/mongo/db/exec/sbe/vm/vm_printer.cpp b/src/mongo/db/exec/sbe/vm/vm_printer.cpp index 2ed13999339..140e0d99fcb 100644 --- a/src/mongo/db/exec/sbe/vm/vm_printer.cpp +++ b/src/mongo/db/exec/sbe/vm/vm_printer.cpp @@ -26,8 +26,7 @@ * exception statement from all source files in the program, then also delete * it in the license file. */ - -#include <boost/format.hpp> +#include <iomanip> #include "mongo/db/exec/sbe/values/value_printer.h" #include "mongo/db/exec/sbe/vm/vm.h" @@ -124,7 +123,11 @@ template <typename charT, typename traits> std::basic_ostream<charT, traits>& operator<<( std::basic_ostream<charT, traits>& os, const CodeFragmentFormatter<CodeFragmentPrinter::PrintFormat::Stable>::PcPointerFmt& a) { - return os << (boost::format("0x%04x") % (a.pcPointer - a.pcBegin)); + + auto flags = os.flags(); + os << "0x" << std::hex << std::setw(4) << std::setfill('0') << (a.pcPointer - a.pcBegin); + os.flags(flags); + return os; } template <typename charT, typename traits> |