Skip to content

Commit

Permalink
Expose eastl_enabled boolean, workaround for buggy fixed_hash_map::re…
Browse files Browse the repository at this point in the history
…serve()
  • Loading branch information
fwsGonzo committed Oct 8, 2023
1 parent 18dfb8e commit 9d26fa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/libriscv/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ namespace riscv
#else
static constexpr bool memory_arena_is_default = false;
#endif
#ifdef EASTL_ENABLED
static constexpr bool eastl_enabled = true;
#else
static constexpr bool eastl_enabled = false;
#endif
}

namespace riscv
Expand Down
5 changes: 4 additions & 1 deletion lib/libriscv/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,10 @@ namespace riscv
{
// Hardly any pages are dont_fork, so we estimate that
// all master pages will be loaned.
m_pages.reserve(master.memory.pages().size());
if constexpr (!eastl_enabled) {
// Workaround for buggy EASTL behavior.
m_pages.reserve(master.memory.pages().size());
}
for (const auto& it : master.memory.pages())
{
const auto& page = it.second;
Expand Down

0 comments on commit 9d26fa5

Please sign in to comment.