mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-05 02:22:21 +03:00
redo using allocator
This commit is contained in:
parent
02b7e72766
commit
b0a7d86fbd
@ -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<HypoCoverage const, MiniStack> > (mgr.GetPool());
|
||||
m_coll = new Coll();
|
||||
}
|
||||
alloc = new MemPoolAllocator< std::pair<HypoCoverage const, MiniStack> > (pool);
|
||||
m_coll = new (pool.Allocate<Coll>()) Coll(*alloc);}
|
||||
|
||||
Stack::~Stack() {
|
||||
delete m_coll;
|
||||
delete alloc;
|
||||
}
|
||||
|
||||
void Stack::Add(const Hypothesis *hypo, Recycler<Hypothesis*> &hypoRecycle)
|
||||
|
@ -62,8 +62,8 @@ public:
|
||||
typedef boost::unordered_map<HypoCoverage,
|
||||
MiniStack,
|
||||
boost::hash<HypoCoverage>,
|
||||
std::equal_to<HypoCoverage>
|
||||
// MemPoolAllocator< std::pair<HypoCoverage const, MiniStack> >
|
||||
std::equal_to<HypoCoverage>,
|
||||
MemPoolAllocator< std::pair<HypoCoverage const, MiniStack> >
|
||||
> Coll;
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
//MemPoolAllocator< std::pair<HypoCoverage const, MiniStack> > *alloc;
|
||||
MemPoolAllocator< std::pair<HypoCoverage const, MiniStack> > *alloc;
|
||||
Coll *m_coll;
|
||||
|
||||
StackAdd Add(const Hypothesis *hypo);
|
||||
|
Loading…
Reference in New Issue
Block a user