diff options
| author | 2021-04-09 01:17:47 +0100 | |
|---|---|---|
| committer | 2021-04-09 01:18:06 +0100 | |
| commit | 4232adcb5a6be69f7f2b54348ffbeedced81ffe7 (patch) | |
| tree | 3ec8fd3544ec313cb3a899210575fbbe99fdccec | |
| parent | Migrate IOHookProvider from reference<> to std::shared_ptr<>. (diff) | |
Replace interfacebase with deleted operator new.
| -rw-r--r-- | include/base.h | 14 | ||||
| -rw-r--r-- | include/dynref.h | 4 |
2 files changed, 3 insertions, 15 deletions
diff --git a/include/base.h b/include/base.h index 1a733ac79..7b737f45e 100644 --- a/include/base.h +++ b/include/base.h @@ -34,20 +34,6 @@ #include "utility/uncopiable.h" #include "cull.h" -/** The base class for inspircd classes that provide a wrapping interface, and - * should only exist while being used. Prevents heap allocation. - */ -class CoreExport interfacebase - : private insp::uncopiable -{ - public: - interfacebase() = default; - static inline void* operator new(size_t, void* m) { return m; } - private: - static void* operator new(size_t); - static void operator delete(void*); -}; - /** The base class for inspircd classes that support reference counting. * Any objects that do not have a well-defined lifetime should inherit from * this, and should be assigned to a reference<type> object to establish their diff --git a/include/dynref.h b/include/dynref.h index a8125b587..6fdd24d74 100644 --- a/include/dynref.h +++ b/include/dynref.h @@ -22,7 +22,7 @@ #include "base.h" -class CoreExport dynamic_reference_base : public interfacebase, public insp::intrusive_list_node<dynamic_reference_base> +class CoreExport dynamic_reference_base : public insp::intrusive_list_node<dynamic_reference_base> { public: class CaptureHook @@ -37,6 +37,8 @@ class CoreExport dynamic_reference_base : public interfacebase, public insp::int std::string name; CaptureHook* hook = nullptr; void resolve(); + static void* operator new(std::size_t) = delete; + static void* operator new[](std::size_t) = delete; protected: ServiceProvider* value = nullptr; public: |
