From 783e0524bcadb97d47d60b60e5d31e646325e84f Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Mon, 23 Mar 2020 10:09:27 +0300 Subject: [PATCH] Switch to std::map --- runtime/src/main/cpp/Memory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/cpp/Memory.cpp b/runtime/src/main/cpp/Memory.cpp index a51ad342add..f19ef114efd 100644 --- a/runtime/src/main/cpp/Memory.cpp +++ b/runtime/src/main/cpp/Memory.cpp @@ -451,7 +451,9 @@ struct MemoryState { uint64_t allocSinceLastGcThreshold; #endif // USE_GC - KStdUnorderedMap initializingSingletons; + // This map is expected to be small, std::map consumes less memory than + // std::unordered_map and is just as efficient. + KStdOrderedMap initializingSingletons; #if COLLECT_STATISTIC #define CONTAINER_ALLOC_STAT(state, size, container) state->statistic.incAlloc(size, container);