Cycles: Add utility method to vector which totally frees memory used the vector

The method is called vector::free_memory(). Use with care since it'll invalidate
all the pointers to vector memory, all iterators and so on.

Currently unused, but might become handy when clearing unused data.
This commit is contained in:
Sergey Sharybin 2015-02-14 20:49:20 +05:00
parent aad96506c1
commit d0cc1180b0

@ -76,6 +76,11 @@ public:
}
#endif
void free_memory(void) {
std::vector<value_type, allocator_type>::resize(0);
shrink_to_fit();
}
/* Some external API might demand working with std::vector. */
operator std::vector<value_type>()
{