Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/util/util_map.h')
-rw-r--r--intern/cycles/util/util_map.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/util/util_map.h b/intern/cycles/util/util_map.h
index 3c9288417cf..8385b08dd5a 100644
--- a/intern/cycles/util/util_map.h
+++ b/intern/cycles/util/util_map.h
@@ -26,6 +26,13 @@ using std::map;
using std::pair;
using std::unordered_map;
+template<typename T> static void map_free_memory(T &data)
+{
+ /* Use swap() trick to actually free all internal memory. */
+ T empty_data;
+ data.swap(empty_data);
+}
+
CCL_NAMESPACE_END
#endif /* __UTIL_MAP_H__ */