From 7ace85e63646d3fd4843e7f45595bc04f3b2c7dc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 5 Nov 2010 01:20:34 +0000 Subject: PLUGINS: Simplify ELF plugin providers & DLObject subclasses * Remove DLObject virtual methods allocSegment and freeSegment. As long as all DLObject implementations use memalign + free to allocate/release segments, there is no point in wrapping those. This enables further simplifications. * Add TemplatedELFPlugin template class. Use this instead of explicit ELFPlugin subclasses. * Rename DLObject::discard_symtab to discardSymtab svn-id: r54082 --- backends/plugins/wii/wii-provider.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'backends/plugins/wii/wii-provider.cpp') diff --git a/backends/plugins/wii/wii-provider.cpp b/backends/plugins/wii/wii-provider.cpp index 25f54f02de..b05bc59432 100644 --- a/backends/plugins/wii/wii-provider.cpp +++ b/backends/plugins/wii/wii-provider.cpp @@ -32,43 +32,15 @@ #include "backends/plugins/elf/ppc-loader.h" class WiiDLObject : public PPCDLObject { -public: - WiiDLObject() : - PPCDLObject() { - } - - virtual ~WiiDLObject() { - unload(); - } - protected: - virtual void *allocSegment(size_t boundary, size_t size) const { - return memalign(boundary, size); - } - - virtual void freeSegment(void *segment) const { - free(segment); - } - virtual void flushDataCache(void *ptr, uint32 len) const { DCFlushRange(ptr, len); ICInvalidateRange(ptr, len); } }; -class WiiPlugin : public ELFPlugin { -public: - WiiPlugin(const Common::String &filename) : - ELFPlugin(filename) { - } - - virtual DLObject *makeDLObject() { - return new WiiDLObject(); - } -}; - Plugin *WiiPluginProvider::createPlugin(const Common::FSNode &node) const { - return new WiiPlugin(node.getPath()); + return new TemplatedELFPlugin(node.getPath()); } #endif // defined(DYNAMIC_MODULES) && defined(__WII__) -- cgit v1.2.3