From 79d91a572df2a1b8986f1f6e9244b11edc66bccd Mon Sep 17 00:00:00 2001 From: nicolabertoldi Date: Wed, 9 Jun 2010 14:34:15 +0000 Subject: [PATCH] memory-unmap moved into the destructor git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3316 1f5c12ca-751b-0410-a591-d2e778427230 --- moses/src/LanguageModelIRST.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/moses/src/LanguageModelIRST.cpp b/moses/src/LanguageModelIRST.cpp index fc9d00cad..63c8a0f97 100644 --- a/moses/src/LanguageModelIRST.cpp +++ b/moses/src/LanguageModelIRST.cpp @@ -50,6 +50,12 @@ LanguageModelIRST::LanguageModelIRST(bool registerScore, ScoreIndexManager &scor LanguageModelIRST::~LanguageModelIRST() { + +#ifndef WIN32 + TRACE_ERR( "reset mmap\n"); + m_lmtb->reset_mmap(); +#endif + delete m_lmtb; delete m_lmtb_ng; } @@ -235,12 +241,7 @@ void LanguageModelIRST::CleanUpAfterSentenceProcessing() if (LMCacheCleanup(sentenceCount, lmcache_cleanup_threshold)){ TRACE_ERR( "reset caches\n"); m_lmtb->reset_caches(); - -#ifndef WIN32 - TRACE_ERR( "reset mmap\n"); - m_lmtb->reset_mmap(); -#endif - } + } } void LanguageModelIRST::InitializeBeforeSentenceProcessing(){