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/util_aligned_malloc.h')
-rw-r--r--intern/cycles/util/util_aligned_malloc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/util/util_aligned_malloc.h b/intern/cycles/util/util_aligned_malloc.h
index 0f006e95f6a..a76884b20a5 100644
--- a/intern/cycles/util/util_aligned_malloc.h
+++ b/intern/cycles/util/util_aligned_malloc.h
@@ -30,6 +30,13 @@ void *util_aligned_malloc(size_t size, int alignment);
/* Free memory allocated by util_aligned_malloc. */
void util_aligned_free(void *ptr);
+/* Aligned new operator. */
+template<typename T> T *util_aligned_new()
+{
+ void *mem = util_aligned_malloc(sizeof(T), alignof(T));
+ return new (mem) T();
+}
+
CCL_NAMESPACE_END
#endif /* __UTIL_ALIGNED_MALLOC_H__ */