diff options
author | Chris Robinson <[email protected]> | 2023-12-16 17:48:33 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-16 17:48:33 -0800 |
commit | bc83c874ff15b29fdab9b6c0bf40b268345b3026 (patch) | |
tree | 41691ecf41423d015726c334987df70bdf9b5396 /common | |
parent | 4fb33be2b4cb548b4116ee4124ba3d8d2bcecb82 (diff) |
Remove DEF_NEWDEL
C++17 provides alignment-aware allocators for us, so we don't need to use our
own to make sure classes/structs are properly aligned.
Diffstat (limited to 'common')
-rw-r--r-- | common/almalloc.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/common/almalloc.h b/common/almalloc.h index b3d8dd58..7ac02bf1 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -26,19 +26,6 @@ void *al_calloc(size_t alignment, size_t size); void operator delete(void*) noexcept = delete; \ void operator delete[](void*) noexcept = delete; -#define DEF_NEWDEL(T) \ - void *operator new(size_t size) \ - { \ - static_assert(&operator new == &T::operator new, \ - "Incorrect container type specified"); \ - if(void *ret{al_malloc(alignof(T), size)}) \ - return ret; \ - throw std::bad_alloc(); \ - } \ - void *operator new[](size_t size) { return operator new(size); } \ - void operator delete(void *block) noexcept { al_free(block); } \ - void operator delete[](void *block) noexcept { operator delete(block); } - #define DEF_PLACE_NEWDEL \ void *operator new(size_t) = delete; \ void *operator new[](size_t) = delete; \ |