aboutsummaryrefslogtreecommitdiffstats
path: root/common/almalloc.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-23 16:00:50 -0700
committerChris Robinson <[email protected]>2020-03-23 16:00:50 -0700
commit6a3b3b180b7138e1ea1c9a2e345747e69d664411 (patch)
tree63facb74da575ac03a828d8f56f03cb5513d34f2 /common/almalloc.h
parentb53294e291c0e00b94639527ae84d03037029f1a (diff)
Add a macro to disable class-specific new/delete
Diffstat (limited to 'common/almalloc.h')
-rw-r--r--common/almalloc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/almalloc.h b/common/almalloc.h
index d56c8543..fc83b0d8 100644
--- a/common/almalloc.h
+++ b/common/almalloc.h
@@ -18,6 +18,12 @@ void *al_calloc(size_t alignment, size_t size);
void al_free(void *ptr) noexcept;
+#define DISABLE_ALLOC() \
+ void *operator new(size_t) = delete; \
+ void *operator new[](size_t) = delete; \
+ void operator delete(void*) noexcept = delete; \
+ void operator delete[](void*) noexcept = delete;
+
#define DEF_NEWDEL(T) \
void *operator new(size_t size) \
{ \