mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-04 00:39:53 +02:00
Better memory statistics.
This commit is contained in:
@@ -175,9 +175,9 @@ AnnotationShapes::undo (db::Op *op)
|
||||
}
|
||||
|
||||
void
|
||||
AnnotationShapes::collect_mem_stat (db::MemStatistics &m) const
|
||||
AnnotationShapes::mem_stat (db::MemStatistics *stat, db::MemStatistics::purpose_t purpose, int cat, bool no_self, void *parent) const
|
||||
{
|
||||
m_layer.collect_mem_stat (m);
|
||||
m_layer.mem_stat (stat, purpose, cat, no_self, parent);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -347,7 +347,7 @@ public:
|
||||
/**
|
||||
* @brief Collect memory usage
|
||||
*/
|
||||
void collect_mem_stat (db::MemStatistics &m) const;
|
||||
void mem_stat (db::MemStatistics *stat, db::MemStatistics::purpose_t purpose, int cat, bool no_self, void *parent) const;
|
||||
|
||||
private:
|
||||
void invalidate_state ()
|
||||
@@ -360,6 +360,15 @@ private:
|
||||
layer_type m_layer;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Collect memory usage
|
||||
*/
|
||||
inline void mem_stat (db::MemStatistics *stat, db::MemStatistics::purpose_t purpose, int cat, const AnnotationShapes &x, bool no_self = false, void *parent = 0)
|
||||
{
|
||||
x.mem_stat (stat, purpose, cat, no_self, parent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2883,8 +2883,8 @@ LayoutView::reload_layout (unsigned int cv_index)
|
||||
|
||||
// print the memory statistics now.
|
||||
if (tl::verbosity () >= 31) {
|
||||
db::MemStatistics m;
|
||||
cv->layout ().collect_mem_stat (m);
|
||||
db::MemStatisticsCollector m (false);
|
||||
cv->layout ().mem_stat (&m, db::MemStatistics::LayoutInfo, 0);
|
||||
m.print ();
|
||||
}
|
||||
|
||||
@@ -3120,8 +3120,8 @@ LayoutView::load_layout (const std::string &filename, const db::LoadLayoutOption
|
||||
|
||||
// print the memory statistics now.
|
||||
if (tl::verbosity () >= 31) {
|
||||
db::MemStatistics m;
|
||||
cv->layout ().collect_mem_stat (m);
|
||||
db::MemStatisticsCollector m (false);
|
||||
cv->layout ().mem_stat (&m, db::MemStatistics::LayoutInfo, 0);
|
||||
m.print ();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,13 @@ public:
|
||||
|
||||
const Sh &shape () const { return m_shape; }
|
||||
|
||||
size_t mem_used () const { return 0; }
|
||||
size_t mem_reqd () const { return 0; }
|
||||
virtual void mem_stat (db::MemStatistics *stat, db::MemStatistics::purpose_t purpose, int cat, bool no_self, void *parent) const
|
||||
{
|
||||
if (! no_self) {
|
||||
stat->add (typeid (*this), (void *) this, sizeof (*this), sizeof (*this), parent, purpose, cat);
|
||||
}
|
||||
db::mem_stat (stat, purpose, cat, m_shape, true, (void *) this);
|
||||
}
|
||||
|
||||
private:
|
||||
Sh m_shape;
|
||||
|
||||
Reference in New Issue
Block a user