diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-09-04 15:22:40 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-09-04 15:25:12 +0400 |
commit | fbed2047c8e84a535c32bf3f3fb3ea1791a08571 (patch) | |
tree | bb3f7060849b481f2235ac1ea50dd1caa5efd9c3 /intern/cycles/util | |
parent | 5e3b63a22bfd2f0b6fb683f1ebcac1dc96fc1627 (diff) |
Fix wrong track of the memory when doing device vector resize before freeing it
This is rather legit case which happens i.e. when having persistent images enabled
and session is updating the lookup tables.
Now device_memory keeps track of amount of memory being allocated on the device,
which makes freeing using the proper allocated size, not the CPU side buffer
size.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_stats.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/intern/cycles/util/util_stats.h b/intern/cycles/util/util_stats.h index 62b1f1760d7..8758b823084 100644 --- a/intern/cycles/util/util_stats.h +++ b/intern/cycles/util/util_stats.h @@ -30,6 +30,7 @@ public: } void mem_free(size_t size) { + assert(mem_used >= size); mem_used -= size; } |