summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/fgas_memory.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-04 06:13:45 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-04 06:13:45 -0700
commit2a14bde1011a5d374d1109fd83f59a8ff67c162e (patch)
treee11df29fe4c82e4b502884f5bec8618dfec0491d /xfa/fgas/crt/fgas_memory.cpp
parent4c133f3bce38415597a011f79385ec130c8adbe8 (diff)
downloadpdfium-2a14bde1011a5d374d1109fd83f59a8ff67c162e.tar.xz
Replace IFX_MemoryAllocator::Release() with delete.
All Release() did was invoke delete. Add some "overrides" while we're at it. Review-Url: https://codereview.chromium.org/1951573002
Diffstat (limited to 'xfa/fgas/crt/fgas_memory.cpp')
-rw-r--r--xfa/fgas/crt/fgas_memory.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/xfa/fgas/crt/fgas_memory.cpp b/xfa/fgas/crt/fgas_memory.cpp
index 04c4b31dd0..2bd1e4da83 100644
--- a/xfa/fgas/crt/fgas_memory.cpp
+++ b/xfa/fgas/crt/fgas_memory.cpp
@@ -17,10 +17,9 @@ namespace {
class CFX_DefStore : public IFX_MemoryAllocator, public CFX_Target {
public:
CFX_DefStore() {}
- ~CFX_DefStore() {}
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size) { return FX_Alloc(uint8_t, size); }
- virtual void Free(void* pBlock) { FX_Free(pBlock); }
+ ~CFX_DefStore() override {}
+ void* Alloc(size_t size) override { return FX_Alloc(uint8_t, size); }
+ void Free(void* pBlock) override { FX_Free(pBlock); }
};
} // namespace
@@ -44,10 +43,9 @@ struct FX_STATICSTORECHUNK {
class CFX_StaticStore : public IFX_MemoryAllocator, public CFX_Target {
public:
CFX_StaticStore(size_t iDefChunkSize = 4096);
- ~CFX_StaticStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock) {}
+ ~CFX_StaticStore() override;
+ void* Alloc(size_t size) override;
+ void Free(void* pBlock) override {}
protected:
size_t m_iAllocatedSize;
@@ -70,10 +68,9 @@ struct FX_FIXEDSTORECHUNK {
class CFX_FixedStore : public IFX_MemoryAllocator, public CFX_Target {
public:
CFX_FixedStore(size_t iBlockSize, size_t iBlockNumsInChunk);
- virtual ~CFX_FixedStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock);
+ ~CFX_FixedStore() override;
+ void* Alloc(size_t size) override;
+ void Free(void* pBlock) override;
protected:
FX_FIXEDSTORECHUNK* AllocChunk();