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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-06-27 22:07:43 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-06-27 22:07:43 +0300
commit008da0ff5eeec0ce9bd1fff0151f003f18f0cdd2 (patch)
tree1d1fcd2e7d3d72feab5c003dbe052d8462684b22
parent3d7329950eec5b2784fa6ba5d795849104f37ed5 (diff)
Cycles: Use aligned blender allocator when using guarded allocation
This way we solve possible issues caused by regular allocator not being aware of some classes preferring 16 bytes alignment needed for SSE to work properly. This caused random crashes during rendering. Now we always use aligned allocation in GuardedAllocator which shouldn't be any measurable performance impact and the code is only used by developers after defining special symbol, so there is no impact on release builds at all.
-rw-r--r--intern/cycles/util/util_guarded_allocator.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/util/util_guarded_allocator.h b/intern/cycles/util/util_guarded_allocator.h
index c4edb172eb8..14a680cf01c 100644
--- a/intern/cycles/util/util_guarded_allocator.h
+++ b/intern/cycles/util/util_guarded_allocator.h
@@ -54,7 +54,7 @@ public:
util_guarded_mem_alloc(n * sizeof(T));
#ifdef WITH_BLENDER_GUARDEDALLOC
(void)hint;
- return (T*)MEM_mallocN(n * sizeof(T), "Cycles Alloc");
+ return (T*)MEM_mallocN_aligned(n * sizeof(T), 16, "Cycles Alloc");
#else
return std::allocator<T>::allocate(n, hint);
#endif