diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index e137dada335c0e1aaf8f7b226245248fc99ebc0d..ee4158af923380df3d6500ef634155985976a785 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -341,6 +341,10 @@ template<typename T> inline T *MEM_cnew(const char *allocation_name, const T &ot { \ return MEM_mallocN(num_bytes, _id); \ } \ + void *operator new(size_t num_bytes, std::align_val_t alignment) \ + { \ + return MEM_mallocN_aligned(num_bytes, size_t(alignment), _id); \ + } \ void operator delete(void *mem) \ { \ if (mem) { \ @@ -351,6 +355,10 @@ template<typename T> inline T *MEM_cnew(const char *allocation_name, const T &ot { \ return MEM_mallocN(num_bytes, _id "[]"); \ } \ + void *operator new[](size_t num_bytes, std::align_val_t alignment) \ + { \ + return MEM_mallocN_aligned(num_bytes, size_t(alignment), _id "[]"); \ + } \ void operator delete[](void *mem) \ { \ if (mem) { \