-/* This is now a template in base.h
- *
- * bool Extensible::Extend(const std::string &key, char* p)
- * {
- * // only add an item if it doesnt already exist
- * if (this->Extension_Items.find(key) == this->Extension_Items.end())
- * {
- * this->Extension_Items[key] = p;
- * log(DEBUG,"Extending object with item %s",key.c_str());
- * return true;
- * }
- * // item already exists, return false
- * return false;
- * }
- */
+CullResult::CullResult()
+{
+}
+
+// This trick detects heap allocations of refcountbase objects
+static void* last_heap = NULL;
+
+void* refcountbase::operator new(size_t size)
+{
+ last_heap = ::operator new(size);
+ return last_heap;
+}
+
+void refcountbase::operator delete(void* obj)
+{
+ if (last_heap == obj)
+ last_heap = NULL;
+ ::operator delete(obj);
+}
+
+refcountbase::refcountbase() : refcount(0)
+{
+ if (this != last_heap)
+ throw CoreException("Reference allocate on the stack!");
+}
+
+refcountbase::~refcountbase()
+{
+ if (refcount && ServerInstance && ServerInstance->Logs)
+ ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "refcountbase::~ @%p with refcount %d",
+ (void*)this, refcount);
+}
+
+usecountbase::~usecountbase()
+{
+ if (usecount && ServerInstance && ServerInstance->Logs)
+ ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "usecountbase::~ @%p with refcount %d",
+ (void*)this, usecount);
+}
+
+ServiceProvider::~ServiceProvider()
+{
+}
+
+ExtensionItem::ExtensionItem(const std::string& Key, Module* mod) : ServiceProvider(mod, Key, SERVICE_METADATA)
+{
+}
+
+ExtensionItem::~ExtensionItem()
+{
+}