Blender Git Loki
Git Commits -> Revision c8d2bc7
Revision c8d2bc7 by Sergey Sharybin (master) February 12, 2016, 14:43 (GMT) |
Cycles: Always use guarded allocator of vectors We don't have vectors re-allocation happening multiple times from inside a loop anymore, so we can safely switch to a memory guarded allocator for vectors and keep track on the memory usage at various stages of rendering. Additionally, when building from inside Blender repository, Cycles will use Blender's guarded allocator, so actual memory usage will be displayed in the Space Info header. There are couple of tricky aspects of the patch: - TaskScheduler::exit() now explicitly frees memory used by `threads`. This is needed because `threads` is a static member which destructor isn't getting called on Blender's exit which caused memory leak print to happen. This shouldn't give any measurable speed issues, reallocation of that vector is only one of fewzillion other allocations happening during synchronization. - Use regular guarded malloc (not aligned one). No idea why it was made to be aligned in the first place. Perhaps some corner case tests or so. Vector was never expected to be aligned anyway. Let's see if we'll have actual bugs with this. Reviewers: dingto, lukasstockner97, juicyfruit, brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D1774 |
Commit Details:
Full Hash: c8d2bc78902422c89607a5778857de958e3bb837
Parent Commit: 28604c4
Lines Changed: +125, -59
14 Modified Paths:
/intern/cycles/blender/addon/engine.py (+4, -0) (Diff)
/intern/cycles/blender/addon/__init__.py (+11, -0) (Diff)
/intern/cycles/blender/blender_python.cpp (+15, -4) (Diff)
/intern/cycles/CMakeLists.txt (+1, -0) (Diff)
/intern/cycles/device/device.cpp (+8, -4) (Diff)
/intern/cycles/device/device.h (+3, -0) (Diff)
/intern/cycles/render/scene.cpp (+2, -7) (Diff)
/intern/cycles/render/shader.cpp (+5, -0) (Diff)
/intern/cycles/render/shader.h (+2, -0) (Diff)
/intern/cycles/util/CMakeLists.txt (+2, -9) (Diff)
/intern/cycles/util/util_guarded_allocator.h (+62, -23) (Diff)
/intern/cycles/util/util_task.cpp (+6, -0) (Diff)
/intern/cycles/util/util_task.h (+1, -0) (Diff)
/intern/cycles/util/util_vector.h (+3, -12) (Diff)
/intern/cycles/blender/addon/__init__.py (+11, -0) (Diff)
/intern/cycles/blender/blender_python.cpp (+15, -4) (Diff)
/intern/cycles/CMakeLists.txt (+1, -0) (Diff)
/intern/cycles/device/device.cpp (+8, -4) (Diff)
/intern/cycles/device/device.h (+3, -0) (Diff)
/intern/cycles/render/scene.cpp (+2, -7) (Diff)
/intern/cycles/render/shader.cpp (+5, -0) (Diff)
/intern/cycles/render/shader.h (+2, -0) (Diff)
/intern/cycles/util/CMakeLists.txt (+2, -9) (Diff)
/intern/cycles/util/util_guarded_allocator.h (+62, -23) (Diff)
/intern/cycles/util/util_task.cpp (+6, -0) (Diff)
/intern/cycles/util/util_task.h (+1, -0) (Diff)
/intern/cycles/util/util_vector.h (+3, -12) (Diff)