diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2019-10-03 16:13:17 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2019-10-03 16:13:17 +0300 |
commit | fefde79c899074c22c6fabc8ac7981a34a10a15c (patch) | |
tree | 27d0271079060187ce766396b578bb4bb6156380 /src | |
parent | c4d50ea639ed551aaf9557eb8c584dd4d84b5e38 (diff) |
Make sure no vector reallocation will be performed on pillars.
This is a workaround for now, it needs to be handled properly.
Diffstat (limited to 'src')
-rw-r--r-- | src/libslic3r/SLA/SLASupportTreeBuilder.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libslic3r/SLA/SLASupportTreeBuilder.hpp b/src/libslic3r/SLA/SLASupportTreeBuilder.hpp index 9a0036474..95fcdcc32 100644 --- a/src/libslic3r/SLA/SLASupportTreeBuilder.hpp +++ b/src/libslic3r/SLA/SLASupportTreeBuilder.hpp @@ -309,7 +309,7 @@ public: { std::lock_guard<Mutex> lk(m_mutex); if (m_pillars.capacity() < m_heads.size()) - m_pillars.reserve(m_heads.size() * 2); + m_pillars.reserve(m_heads.size() * 10); assert(headid >= 0 && headid < m_head_indices.size()); Head &head = m_heads[m_head_indices[size_t(headid)]]; @@ -360,7 +360,8 @@ public: { std::lock_guard<Mutex> lk(m_mutex); if (m_pillars.capacity() < m_heads.size()) - m_pillars.reserve(m_heads.size() * 2); + m_pillars.reserve(m_heads.size() * 10); + m_pillars.emplace_back(std::forward<Args>(args)...); Pillar& pillar = m_pillars.back(); pillar.id = long(m_pillars.size() - 1); |