diff --git a/contrib/other-builds/moses2/Search/CubePruning/Misc.cpp b/contrib/other-builds/moses2/Search/CubePruning/Misc.cpp index ca840f2db..3903fb0e9 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Misc.cpp +++ b/contrib/other-builds/moses2/Search/CubePruning/Misc.cpp @@ -46,7 +46,7 @@ void QueueItem::CreateHypothesis(Manager &mgr) //cerr << prevHypo << endl; //cerr << *prevHypo << endl; - hypo = Hypothesis::Create(mgr.system.GetSystemPool(), mgr); + hypo = Hypothesis::Create(mgr.GetSystemPool(), mgr); hypo->Init(mgr, *prevHypo, edge->path, tp, edge->newBitmap, edge->estimatedScore); hypo->EvaluateWhenApplied(); } diff --git a/contrib/other-builds/moses2/Search/CubePruning/Search.cpp b/contrib/other-builds/moses2/Search/CubePruning/Search.cpp index 0fcaef2e0..3d2cc80be 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Search.cpp +++ b/contrib/other-builds/moses2/Search/CubePruning/Search.cpp @@ -51,7 +51,7 @@ void Search::Decode() } const Bitmap &initBitmap = m_mgr.GetBitmaps().GetInitialBitmap(); - Hypothesis *initHypo = Hypothesis::Create(m_mgr.system.GetSystemPool(), m_mgr); + Hypothesis *initHypo = Hypothesis::Create(m_mgr.GetSystemPool(), m_mgr); initHypo->Init(m_mgr, m_mgr.GetInputPaths().GetBlank(), m_mgr.GetInitPhrase(), initBitmap); initHypo->EmptyHypothesisState(m_mgr.GetInput()); diff --git a/contrib/other-builds/moses2/Search/Manager.cpp b/contrib/other-builds/moses2/Search/Manager.cpp index c536d54c1..9684bbfa4 100644 --- a/contrib/other-builds/moses2/Search/Manager.cpp +++ b/contrib/other-builds/moses2/Search/Manager.cpp @@ -45,6 +45,7 @@ void Manager::Init() { // init pools etc m_pool = &system.GetManagerPool(); + m_systemPool = &system.GetSystemPool(); m_hypoRecycle = &system.GetHypoRecycler(); m_initPhrase = new (GetPool().Allocate()) TargetPhrase(GetPool(), system, 0); diff --git a/contrib/other-builds/moses2/Search/Manager.h b/contrib/other-builds/moses2/Search/Manager.h index dc16053e4..530159d4f 100644 --- a/contrib/other-builds/moses2/Search/Manager.h +++ b/contrib/other-builds/moses2/Search/Manager.h @@ -42,6 +42,9 @@ public: MemPool &GetPool() const { return *m_pool; } + MemPool &GetSystemPool() const + { return *m_systemPool; } + Recycler &GetHypoRecycle() const { return *m_hypoRecycle; } @@ -65,7 +68,7 @@ public: void OutputBest() const; protected: - mutable MemPool *m_pool; + mutable MemPool *m_pool, *m_systemPool; mutable Recycler *m_hypoRecycle; std::string m_inputStr; diff --git a/contrib/other-builds/moses2/Search/SearchNormal.cpp b/contrib/other-builds/moses2/Search/SearchNormal.cpp index 2fa9d9fbc..239901108 100644 --- a/contrib/other-builds/moses2/Search/SearchNormal.cpp +++ b/contrib/other-builds/moses2/Search/SearchNormal.cpp @@ -38,7 +38,7 @@ void SearchNormal::Decode() m_stacks.Init(m_mgr.GetInput().GetSize() + 1); const Bitmap &initBitmap = m_mgr.GetBitmaps().GetInitialBitmap(); - Hypothesis *initHypo = Hypothesis::Create(m_mgr.system.GetSystemPool(), m_mgr); + Hypothesis *initHypo = Hypothesis::Create(m_mgr.GetSystemPool(), m_mgr); initHypo->Init(m_mgr, m_mgr.GetInputPaths().GetBlank(), m_mgr.GetInitPhrase(), initBitmap); initHypo->EmptyHypothesisState(m_mgr.GetInput()); @@ -117,7 +117,7 @@ void SearchNormal::Extend(const Hypothesis &hypo, const Bitmap &newBitmap, SCORE estimatedScore) { - Hypothesis *newHypo = Hypothesis::Create(m_mgr.system.GetSystemPool(), m_mgr); + Hypothesis *newHypo = Hypothesis::Create(m_mgr.GetSystemPool(), m_mgr); newHypo->Init(m_mgr, hypo, path, tp, newBitmap, estimatedScore); newHypo->EvaluateWhenApplied(); diff --git a/contrib/other-builds/moses2/Search/SearchNormalBatch.cpp b/contrib/other-builds/moses2/Search/SearchNormalBatch.cpp index 517cf7822..8e414869c 100644 --- a/contrib/other-builds/moses2/Search/SearchNormalBatch.cpp +++ b/contrib/other-builds/moses2/Search/SearchNormalBatch.cpp @@ -42,7 +42,7 @@ void SearchNormalBatch::Decode() m_stacks.Init(m_mgr.GetInput().GetSize() + 1); const Bitmap &initBitmap = m_mgr.GetBitmaps().GetInitialBitmap(); - Hypothesis *initHypo = Hypothesis::Create(m_mgr.system.GetSystemPool(), m_mgr); + Hypothesis *initHypo = Hypothesis::Create(m_mgr.GetSystemPool(), m_mgr); initHypo->Init(m_mgr, m_mgr.GetInputPaths().GetBlank(), m_mgr.GetInitPhrase(), initBitmap); initHypo->EmptyHypothesisState(m_mgr.GetInput()); @@ -150,7 +150,7 @@ void SearchNormalBatch::Extend(const Hypothesis &hypo, const Bitmap &newBitmap, SCORE estimatedScore) { - Hypothesis *newHypo = Hypothesis::Create(m_mgr.system.GetSystemPool(), m_mgr); + Hypothesis *newHypo = Hypothesis::Create(m_mgr.GetSystemPool(), m_mgr); newHypo->Init(m_mgr, hypo, path, tp, newBitmap, estimatedScore); newHypo->EvaluateWhenAppliedNonBatch();