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')
-rw-r--r--intern/cycles/util/util_aligned_malloc.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/util/util_aligned_malloc.cpp b/intern/cycles/util/util_aligned_malloc.cpp
index 51f21db2dc3..3e825ce2e0f 100644
--- a/intern/cycles/util/util_aligned_malloc.cpp
+++ b/intern/cycles/util/util_aligned_malloc.cpp
@@ -15,6 +15,7 @@
*/
#include "util_aligned_malloc.h"
+#include "util_guarded_allocator.h"
#include <cassert>
@@ -41,6 +42,9 @@ CCL_NAMESPACE_BEGIN
void *util_aligned_malloc(int size, int alignment)
{
+#ifdef WITH_BLENDER_GUARDEDALLOC
+ return MEM_mallocN_aligned(size, alignment, "Cycles Aligned Alloc");
+#endif
#ifdef _WIN32
return _aligned_malloc(size, alignment);
#elif defined(__APPLE__)
@@ -65,7 +69,11 @@ void *util_aligned_malloc(int size, int alignment)
void util_aligned_free(void *ptr)
{
-#ifdef _WIN32
+#if defined(WITH_BLENDER_GUARDEDALLOC)
+ if(ptr != NULL) {
+ MEM_freeN(ptr);
+ }
+#elif defined(_WIN32)
_aligned_free(ptr);
#else
free(ptr);