From 22f0329abc7aa7f6b034333449892e5e579b8fb7 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 29 Dec 2015 22:03:23 +0000 Subject: [PATCH] don't use allocator --- .../other-builds/moses2/Search/CubePruning/Search.cpp | 11 +++++++---- .../other-builds/moses2/Search/CubePruning/Search.h | 3 +-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/contrib/other-builds/moses2/Search/CubePruning/Search.cpp b/contrib/other-builds/moses2/Search/CubePruning/Search.cpp index dfa2f049e..4b1a9e24f 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Search.cpp +++ b/contrib/other-builds/moses2/Search/CubePruning/Search.cpp @@ -29,12 +29,15 @@ Search::Search(Manager &mgr) ,m_stacks(mgr) ,m_queue(mgr.system.GetQueue()) ,m_seenPositions(mgr.system.GetSeenPositions()) -,m_cubeEdgesAlloc(mgr.GetPool()) -,m_cubeEdges(m_cubeEdgesAlloc) { } -Search::~Search() { +Search::~Search() +{ + BOOST_FOREACH(CubeEdges &edges, m_cubeEdges) { + RemoveAllInColl(edges); + } + } void Search::Decode() @@ -171,7 +174,7 @@ void Search::PostDecode(size_t stackInd) BOOST_FOREACH(const TargetPhrases *tps, path.targetPhrases) { if (tps && tps->GetSize()) { - CubeEdge *edge = new (pool.Allocate()) CubeEdge(m_mgr, sortedHypos, path, *tps, newBitmap); + CubeEdge *edge = new CubeEdge(m_mgr, sortedHypos, path, *tps, newBitmap); edges.push_back(edge); } } diff --git a/contrib/other-builds/moses2/Search/CubePruning/Search.h b/contrib/other-builds/moses2/Search/CubePruning/Search.h index 766724841..fabebd1a1 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Search.h +++ b/contrib/other-builds/moses2/Search/CubePruning/Search.h @@ -41,8 +41,7 @@ protected: // setup typedef std::list CubeEdges; - MemPoolAllocator m_cubeEdgesAlloc; - std::vector > m_cubeEdges; + std::vector m_cubeEdges; // CUBE PRUNING // decoding