diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-30 11:04:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-30 11:06:19 +0200 |
commit | 98323f936ba454f974d168e79f2187a8d3324ef0 (patch) | |
tree | 713e4ba1a4b7f49c070dd91ccb36065170529050 /store/source/storcach.cxx | |
parent | Remove OStorePageData typedef (diff) | |
download | core-98323f936ba454f974d168e79f2187a8d3324ef0.tar.gz core-98323f936ba454f974d168e79f2187a8d3324ef0.zip |
cid#1371195, cide#1371212: Replace PageHolder with shared_ptr
...removing the need for SharedCount, too
Change-Id: I20c724c940c571aef1c12453da30c3e9fbb46466
Diffstat (limited to 'store/source/storcach.cxx')
-rw-r--r-- | store/source/storcach.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index a37a0175fa8d..8825d690250a 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -31,6 +31,7 @@ #include "object.hxx" #include "storbase.hxx" +#include <memory> #include <stddef.h> using namespace store; @@ -41,7 +42,7 @@ namespace store { struct Entry { // Representation - PageHolder m_xPage; + std::shared_ptr<PageData> m_xPage; sal_uInt32 m_nOffset; Entry * m_pNext; @@ -50,7 +51,7 @@ struct Entry static void operator delete (void *, void *) {} // Construction - explicit Entry (PageHolder const & rxPage = PageHolder(), sal_uInt32 nOffset = STORE_PAGE_NULL) + explicit Entry (std::shared_ptr<PageData> const & rxPage = std::shared_ptr<PageData>(), sal_uInt32 nOffset = STORE_PAGE_NULL) : m_xPage(rxPage), m_nOffset(nOffset), m_pNext(nullptr) {} @@ -70,7 +71,7 @@ class EntryCache public: static EntryCache & get(); - Entry * create (PageHolder const & rxPage, sal_uInt32 nOffset); + Entry * create (std::shared_ptr<PageData> const & rxPage, sal_uInt32 nOffset); void destroy (Entry * entry); @@ -109,7 +110,7 @@ EntryCache::~EntryCache() m_entry_cache = nullptr; } -Entry * EntryCache::create (PageHolder const & rxPage, sal_uInt32 nOffset) +Entry * EntryCache::create (std::shared_ptr<PageData> const & rxPage, sal_uInt32 nOffset) { void * pAddr = rtl_cache_alloc (m_entry_cache); if (pAddr != nullptr) @@ -285,7 +286,7 @@ Entry * PageCache::lookup_Impl (Entry * entry, sal_uInt32 nOffset) return entry; } -storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset) +storeError PageCache::lookupPageAt (std::shared_ptr<PageData> & rxPage, sal_uInt32 nOffset) { OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::lookupPageAt(): invalid Offset"); if (nOffset == STORE_PAGE_NULL) @@ -308,7 +309,7 @@ storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset) return store_E_NotExists; } -storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffset) +storeError PageCache::insertPageAt (std::shared_ptr<PageData> const & rxPage, sal_uInt32 nOffset) { // [SECURITY:ValInput] PageData const * pagedata = rxPage.get(); @@ -340,7 +341,7 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse return store_E_OutOfMemory; } -storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffset) +storeError PageCache::updatePageAt (std::shared_ptr<PageData> const & rxPage, sal_uInt32 nOffset) { // [SECURITY:ValInput] PageData const * pagedata = rxPage.get(); |