WIP: Undo / Redo memory limiting by releasing the least recently

used snapshots. Memory limit set to 10% of physical system memory.
This commit is contained in:
bubnikv 2019-07-17 15:48:53 +02:00
parent 4865240a9c
commit 3a74e7ab69
12 changed files with 411 additions and 82 deletions

View file

@ -127,6 +127,10 @@ struct stl_file {
this->stats.reset();
}
size_t memsize() const {
return sizeof(*this) + sizeof(stl_facet) * facet_start.size() + sizeof(stl_neighbors) * neighbors_start.size();
}
std::vector<stl_facet> facet_start;
std::vector<stl_neighbors> neighbors_start;
// Statistics
@ -139,6 +143,10 @@ struct indexed_triangle_set
void clear() { indices.clear(); vertices.clear(); }
size_t memsize() const {
return sizeof(*this) + sizeof(stl_triangle_vertex_indices) * indices.size() + sizeof(stl_vertex) * vertices.size();
}
std::vector<stl_triangle_vertex_indices> indices;
std::vector<stl_vertex> vertices;
//FIXME add normals once we get rid of the stl_file from TriangleMesh completely.