diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 76d1b60ee2b..c02ff5371bb 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -353,7 +353,7 @@ template inline T *MEM_cnew_array(const size_t length, const char *a template inline T *MEM_cnew(const char *allocation_name, const T &other) { static_assert(std::is_trivial_v, "For non-trivial types, MEM_new should be used."); - T *new_object = static_cast(MEM_mallocN(sizeof(T), allocation_name)); + T *new_object = static_cast(MEM_mallocN_aligned(sizeof(T), alignof(T), allocation_name)); if (new_object) { memcpy(new_object, &other, sizeof(T)); }