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-02-19 20:17:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-02-19 20:19:29 +0300
commit83220ab7fb9af6a34b30cdcb0ba9394e710d418b (patch)
tree700290f37b6fb2f8d7b3e9e6d505c1ae7c504495 /intern/cycles/util
parent2ddfd3a1235a50906d55f2b978f0ba03547d24e3 (diff)
Cycles: Use size_t for aligned allocator
Seems it got changes by accident to int during guarded allocation work, causing bad memory allocations.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_aligned_malloc.cpp2
-rw-r--r--intern/cycles/util/util_aligned_malloc.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/util/util_aligned_malloc.cpp b/intern/cycles/util/util_aligned_malloc.cpp
index 3e825ce2e0f..9ff857e3543 100644
--- a/intern/cycles/util/util_aligned_malloc.cpp
+++ b/intern/cycles/util/util_aligned_malloc.cpp
@@ -40,7 +40,7 @@
CCL_NAMESPACE_BEGIN
-void *util_aligned_malloc(int size, int alignment)
+void *util_aligned_malloc(size_t size, int alignment)
{
#ifdef WITH_BLENDER_GUARDEDALLOC
return MEM_mallocN_aligned(size, alignment, "Cycles Aligned Alloc");
diff --git a/intern/cycles/util/util_aligned_malloc.h b/intern/cycles/util/util_aligned_malloc.h
index 28c240a20e7..ecc0f28c376 100644
--- a/intern/cycles/util/util_aligned_malloc.h
+++ b/intern/cycles/util/util_aligned_malloc.h
@@ -17,10 +17,12 @@
#ifndef __UTIL_ALIGNED_MALLOC_H__
#define __UTIL_ALIGNED_MALLOC_H__
+#include "util_types.h"
+
CCL_NAMESPACE_BEGIN
/* Allocate block of size bytes at least aligned to a given value. */
-void *util_aligned_malloc(int size, int alignment);
+void *util_aligned_malloc(size_t size, int alignment);
/* Free memory allocated by util_aligned_malloc. */
void util_aligned_free(void *ptr);