diff options
author | Max Horn | 2010-11-05 01:20:34 +0000 |
---|---|---|
committer | Max Horn | 2010-11-05 01:20:34 +0000 |
commit | 7ace85e63646d3fd4843e7f45595bc04f3b2c7dc (patch) | |
tree | 31fb058c695dab2969f5bf6a4f33db6973c20a33 /backends/plugins/ds | |
parent | 102e7ee88cf04fa470ec372a1ac38846d278d463 (diff) | |
download | scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.tar.gz scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.tar.bz2 scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.zip |
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
Diffstat (limited to 'backends/plugins/ds')
-rw-r--r-- | backends/plugins/ds/ds-provider.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
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<DSDLObject>(node.getPath()); } #endif // defined(DYNAMIC_MODULES) && defined(__DS__) |