stack pruning

This commit is contained in:
Hieu Hoang 2015-11-05 14:42:49 +00:00
parent d0560722cd
commit b8a8876a99
2 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,17 @@
using namespace std;
Hypothesis::Hypothesis(Manager &mgr)
:m_mgr(mgr)
{
MemPool &pool = m_mgr.GetPool();
size_t numStatefulFFs = m_mgr.GetSystem().featureFunctions.GetStatefulFeatureFunctions().size();
m_ffStates = (const Moses::FFState **) pool.Allocate(sizeof(Moses::FFState*) * numStatefulFFs);
m_scores = new (pool.Allocate<Scores>()) Scores(pool, m_mgr.GetSystem().featureFunctions.GetNumScores());
}
Hypothesis::Hypothesis(Manager &mgr,
const TargetPhrase &tp,
const Moses::Range &range,

View File

@ -23,6 +23,7 @@ class Scores;
class Hypothesis {
friend std::ostream& operator<<(std::ostream &, const Hypothesis &);
public:
Hypothesis(Manager &mgr);
Hypothesis(Manager &mgr,
const TargetPhrase &tp,
const Moses::Range &range,