Memory optimization of SLA export,
logging of memory consumption during SLA slicing (just on Windows as of now).
This commit is contained in:
parent
e9d629f248
commit
ca50d1b55a
2 changed files with 7 additions and 10 deletions
|
@ -20,29 +20,26 @@ class RawBytes {
|
||||||
void operator()(std::uint8_t *rawptr);
|
void operator()(std::uint8_t *rawptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<std::uint8_t, MinzDeleter> m_buffer = nullptr;
|
std::vector<std::uint8_t> m_buffer;
|
||||||
size_t m_size = 0;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RawBytes() = default;
|
RawBytes() = default;
|
||||||
RawBytes(std::uint8_t *rawptr, size_t s): m_buffer(rawptr), m_size(s) {}
|
RawBytes(std::uint8_t *rawptr, size_t s): m_buffer(rawptr, rawptr + s) { MinzDeleter()(rawptr); }
|
||||||
|
|
||||||
size_t size() const { return m_size; }
|
size_t size() const { return m_buffer.size(); }
|
||||||
const uint8_t * data() { return m_buffer.get(); }
|
const uint8_t * data() { return m_buffer.data(); }
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////
|
||||||
// FIXME: the following is needed for MSVC2013 compatibility
|
// FIXME: the following is needed for MSVC2013 compatibility
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
RawBytes(const RawBytes&) = delete;
|
RawBytes(const RawBytes&) = delete;
|
||||||
RawBytes(RawBytes&& mv):
|
RawBytes(RawBytes&& mv) : m_buffer(std::move(mv.m_buffer)) {}
|
||||||
m_buffer(std::move(mv.m_buffer)), m_size(mv.m_size) {}
|
|
||||||
|
|
||||||
RawBytes& operator=(const RawBytes&) = delete;
|
RawBytes& operator=(const RawBytes&) = delete;
|
||||||
RawBytes& operator=(RawBytes&& mv) {
|
RawBytes& operator=(RawBytes&& mv) {
|
||||||
m_buffer.swap(mv.m_buffer);
|
m_buffer = std::move(mv.m_buffer);
|
||||||
m_size = mv.m_size;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1823,7 +1823,7 @@ void SLAPrint::StatusReporter::operator()(
|
||||||
SLAPrint &p, double st, const std::string &msg, unsigned flags)
|
SLAPrint &p, double st, const std::string &msg, unsigned flags)
|
||||||
{
|
{
|
||||||
m_st = st;
|
m_st = st;
|
||||||
BOOST_LOG_TRIVIAL(info) << st << "% " << msg;
|
BOOST_LOG_TRIVIAL(info) << st << "% " << msg << log_memory_info();
|
||||||
p.set_status(int(std::round(st)), msg, flags);
|
p.set_status(int(std::round(st)), msg, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue