Cannot have a const pointer returned to the pool
This commit is contained in:
1 parent
a4575e3fa3
commit
ad6fc6d23b
3 files changed
+5
-5
No files matched your search
@@ -62,7 +62,7 @@ void MBOWriter::publish_snapshot(SecurityKey key, MBOSnapshot* snapshot) {
|
||||
|
||||
MBOReader::MBOReader(std::shared_ptr<MBOProcessorImpl>& 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ class MBOReader {
|
||||
MBOReader(std::shared_ptr<MBOProcessorImpl>&);
|
||||
~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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user