mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
don't free mem on reset
This commit is contained in:
parent
456ae6cf35
commit
59272a0180
@ -27,7 +27,6 @@ MemPool::Page::~Page()
|
||||
MemPool::MemPool(size_t initSize)
|
||||
:m_currSize(initSize)
|
||||
,m_currPage(0)
|
||||
,m_count(0)
|
||||
{
|
||||
Page *page = new Page(m_currSize);
|
||||
m_pages.push_back(page);
|
||||
@ -76,26 +75,6 @@ void *MemPool::More(std::size_t size)
|
||||
void MemPool::Reset()
|
||||
{
|
||||
m_currPage = 0;
|
||||
|
||||
if (m_count == 1000) {
|
||||
//cerr << "chop ";
|
||||
for (size_t i = 0; i < m_pages.size(); ++i) {
|
||||
//cerr << i << " ";
|
||||
}
|
||||
//cerr << endl;
|
||||
RemoveAllInColl(m_pages);
|
||||
|
||||
Page *page = new Page(m_currSize);
|
||||
m_pages.push_back(page);
|
||||
|
||||
current_ = page->mem;
|
||||
|
||||
m_count = 0;
|
||||
}
|
||||
else {
|
||||
current_ = m_pages[0]->mem;
|
||||
|
||||
++m_count;
|
||||
}
|
||||
current_ = m_pages[0]->mem;
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,6 @@ class MemPool {
|
||||
size_t m_currPage;
|
||||
uint8_t *current_;
|
||||
|
||||
size_t m_count;
|
||||
|
||||
// no copying
|
||||
MemPool(const MemPool &);
|
||||
MemPool &operator=(const MemPool &);
|
||||
|
Loading…
Reference in New Issue
Block a user