diff --git a/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp b/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp index 237051537..b8a2c75f5 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp +++ b/contrib/other-builds/moses2/Search/CubePruning/Stack.cpp @@ -82,15 +82,14 @@ void MiniStack::SortAndPruneHypos(const Manager &mgr) const /////////////////////////////////////////////////////////////// Stack::Stack(const Manager &mgr) { - //MemPool &pool = mgr.GetPool(); + MemPool &pool = mgr.GetPool(); //cerr << "Coll=" << sizeof(Coll) << endl; - //alloc = new MemPoolAllocator< std::pair > (mgr.GetPool()); - m_coll = new Coll(); -} + alloc = new MemPoolAllocator< std::pair > (pool); + m_coll = new (pool.Allocate()) Coll(*alloc);} Stack::~Stack() { - delete m_coll; + delete alloc; } void Stack::Add(const Hypothesis *hypo, Recycler &hypoRecycle) diff --git a/contrib/other-builds/moses2/Search/CubePruning/Stack.h b/contrib/other-builds/moses2/Search/CubePruning/Stack.h index 8286805bc..cb08a77c1 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Stack.h +++ b/contrib/other-builds/moses2/Search/CubePruning/Stack.h @@ -62,8 +62,8 @@ public: typedef boost::unordered_map, - std::equal_to - // MemPoolAllocator< std::pair > + std::equal_to, + MemPoolAllocator< std::pair > > Coll; @@ -84,7 +84,7 @@ public: } protected: - //MemPoolAllocator< std::pair > *alloc; + MemPoolAllocator< std::pair > *alloc; Coll *m_coll; StackAdd Add(const Hypothesis *hypo);