forked from bartvdbraak/blender
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:
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>()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user