mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 23:10:31 +03:00
use dequeue. Stack doesn't have clear()
This commit is contained in:
parent
bf8691e94d
commit
b0d97a7974
@ -37,9 +37,8 @@ ManagerBase::~ManagerBase()
|
|||||||
{
|
{
|
||||||
system.featureFunctions.CleanUpAfterSentenceProcessing(*m_input);
|
system.featureFunctions.CleanUpAfterSentenceProcessing(*m_input);
|
||||||
|
|
||||||
if (m_pool) {
|
GetPool().Reset();
|
||||||
GetPool().Reset();
|
GetHypoRecycler().Clear();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ManagerBase::InitPools()
|
void ManagerBase::InitPools()
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <stack>
|
#include <deque>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace Moses2
|
namespace Moses2
|
||||||
@ -25,8 +25,8 @@ public:
|
|||||||
|
|
||||||
T Get() {
|
T Get() {
|
||||||
if (!m_coll.empty()) {
|
if (!m_coll.empty()) {
|
||||||
T &obj = m_coll.top();
|
T &obj = m_coll.back();
|
||||||
m_coll.pop();
|
m_coll.pop_back();
|
||||||
return obj;
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -39,12 +39,12 @@ public:
|
|||||||
|
|
||||||
// call this for existing object to put back into queue for reuse
|
// call this for existing object to put back into queue for reuse
|
||||||
void Recycle(const T& val) {
|
void Recycle(const T& val) {
|
||||||
m_coll.push(val);
|
m_coll.push_back(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// objects that have been give back to us
|
// objects that have been give back to us
|
||||||
std::stack<T> m_coll;
|
std::deque<T> m_coll;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace Moses2 */
|
} /* namespace Moses2 */
|
||||||
|
Loading…
Reference in New Issue
Block a user