diff options
author | Marius Kintel <marius@kintel.net> | 2012-01-06 18:10:33 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-01-09 23:01:50 (GMT) |
commit | fe3362faf825016606a8bcd60669c16965b0599c (patch) | |
tree | 1cfccc34acf462d9faefdfb8662c48cde878cbf9 /src/polyset.cc | |
parent | c4695872392a6d1415752934be55c81de57de87e (diff) |
Started on cache size management: Let cache sizes be read from Preferences, measure cache sizes in bytes
Diffstat (limited to 'src/polyset.cc')
-rw-r--r-- | src/polyset.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/polyset.cc b/src/polyset.cc index 778201b..e5553aa 100644 --- a/src/polyset.cc +++ b/src/polyset.cc @@ -27,6 +27,7 @@ #include "polyset.h" #include "linalg.h" #include <Eigen/LU> +#include <boost/foreach.hpp> /*! /class PolySet @@ -266,3 +267,13 @@ BoundingBox PolySet::getBoundingBox() const } return bbox; } + +size_t PolySet::memsize() const +{ + size_t mem = 0; + BOOST_FOREACH(const Polygon &p, this->polygons) mem += p.size() * sizeof(Vector3d); + BOOST_FOREACH(const Polygon &p, this->borders) mem += p.size() * sizeof(Vector3d); + mem += this->grid.db.size() * (3 * sizeof(int64_t) + sizeof(void*)) + sizeof(Grid3d<void*>); + mem += sizeof(PolySet); + return mem; +} |