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/ds/ds-provider.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'backends/plugins/ds') diff --git a/backends/plugins/ds/ds-provider.cpp b/backends/plugins/ds/ds-provider.cpp index c188b6c9df..832fd1312c 100644 --- a/backends/plugins/ds/ds-provider.cpp +++ b/backends/plugins/ds/ds-provider.cpp @@ -32,43 +32,15 @@ #include "backends/plugins/elf/arm-loader.h" class DSDLObject : public ARMDLObject { -public: - DSDLObject() : - ARMDLObject() { - } - - virtual ~DSDLObject() { - 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 { DC_FlushRange(ptr, len); IC_InvalidateRange(ptr, len); } }; -class DSPlugin : public ELFPlugin { -public: - DSPlugin(const Common::String &filename) : - ELFPlugin(filename) { - } - - virtual DLObject *makeDLObject() { - return new DSDLObject(); - } -}; - Plugin *DSPluginProvider::createPlugin(const Common::FSNode &node) const { - return new DSPlugin(node.getPath()); + return new TemplatedELFPlugin(node.getPath()); } #endif // defined(DYNAMIC_MODULES) && defined(__DS__) -- cgit v1.2.3