From ad6fc6d23b66da40ed5db9f89be2e455e41dbf26 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Fri, 29 Mar 2019 15:38:54 -0400 Subject: [PATCH] Cannot have a const pointer returned to the pool --- src/lib/md/MBOProcessor.cpp | 4 ++-- src/lib/md/MBOProcessor.h | 4 ++-- src/lib/utils/ConcurrentPool.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/md/MBOProcessor.cpp b/src/lib/md/MBOProcessor.cpp index de7fd5363..4f89023a6 100644 --- a/src/lib/md/MBOProcessor.cpp +++ b/src/lib/md/MBOProcessor.cpp @@ -62,7 +62,7 @@ void MBOWriter::publish_snapshot(SecurityKey key, MBOSnapshot* snapshot) { MBOReader::MBOReader(std::shared_ptr& me): _me(me) { } MBOReader::~MBOReader() { } -const MBOSnapshot* MBOReader::acquire_snapshot(SecurityKey key) const { +MBOSnapshot* MBOReader::acquire_snapshot(SecurityKey key) const { // get a result eagerly so we don't have to do it while accessor has the entry locked auto result = _me->pool.allocate(); MapType::const_accessor accessor; @@ -74,7 +74,7 @@ const MBOSnapshot* MBOReader::acquire_snapshot(SecurityKey key) const { } return result; } -void MBOReader::release_snapshot(MBOSnapshot**const s) const { +void MBOReader::release_snapshot(MBOSnapshot**s) const { _me->pool.release(s); } diff --git a/src/lib/md/MBOProcessor.h b/src/lib/md/MBOProcessor.h index 0c02f10dc..04270e8bd 100644 --- a/src/lib/md/MBOProcessor.h +++ b/src/lib/md/MBOProcessor.h @@ -60,8 +60,8 @@ class MBOReader { MBOReader(std::shared_ptr&); ~MBOReader(); public: - const MBOSnapshot* acquire_snapshot(SecurityKey key) const; - void release_snapshot(MBOSnapshot**const) const; + MBOSnapshot* acquire_snapshot(SecurityKey key) const; + void release_snapshot(MBOSnapshot**) const; }; class MBOProcessor { diff --git a/src/lib/utils/ConcurrentPool.h b/src/lib/utils/ConcurrentPool.h index 96802c5dc..91ad99095 100644 --- a/src/lib/utils/ConcurrentPool.h +++ b/src/lib/utils/ConcurrentPool.h @@ -41,7 +41,7 @@ class ConcurrentPool { _all.push_back(std::move(buffer)); } - void release(T**const item) { + void release(T** item) { if (*item) { (*item)->reset(); _free.push(*item);