From 59272a0180e5b678c8a653708a93adc2d8e32b60 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 4 Dec 2015 21:37:10 +0000 Subject: [PATCH] don't free mem on reset --- contrib/other-builds/moses2/MemPool.cpp | 23 +---------------------- contrib/other-builds/moses2/MemPool.h | 2 -- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/contrib/other-builds/moses2/MemPool.cpp b/contrib/other-builds/moses2/MemPool.cpp index 2d2e3494a..62498b223 100644 --- a/contrib/other-builds/moses2/MemPool.cpp +++ b/contrib/other-builds/moses2/MemPool.cpp @@ -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; } diff --git a/contrib/other-builds/moses2/MemPool.h b/contrib/other-builds/moses2/MemPool.h index c39071076..cb130c4ee 100644 --- a/contrib/other-builds/moses2/MemPool.h +++ b/contrib/other-builds/moses2/MemPool.h @@ -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 &);