From fefde79c899074c22c6fabc8ac7981a34a10a15c Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 3 Oct 2019 15:13:17 +0200 Subject: [PATCH] Make sure no vector reallocation will be performed on pillars. This is a workaround for now, it needs to be handled properly. --- src/libslic3r/SLA/SLASupportTreeBuilder.hpp | 5 +++-- 1 file 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 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 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)...); Pillar& pillar = m_pillars.back(); pillar.id = long(m_pillars.size() - 1);