applied patch #1611866 - Fix MMapFile::release(void *pView, int size)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4843 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-12-09 15:17:24 +00:00
parent 4ca1f6d04b
commit ae3373311e
4 changed files with 14 additions and 13 deletions

View file

@ -290,7 +290,7 @@ void *MMapFile::get(int offset, int *sizep) const
return (void *)((char *)m_pView + offset - alignedoffset);
}
void *MMapFile::getmore(int offset, int *size) const
void *MMapFile::getmore(int offset, int size) const
{
void *pView;
void *pViewBackup = m_pView;
@ -324,6 +324,9 @@ void MMapFile::release(void *pView, int size)
if (!pView)
return;
unsigned int alignment = ((unsigned int)pView) % m_iAllocationGranularity;
pView = (char *)pView - alignment;
size += alignment;
#ifdef _WIN32
UnmapViewOfFile(pView);
#else
@ -374,7 +377,7 @@ void *MMapFake::get(int offset, int *size) const
return (void *)(m_pMem + offset);
}
void *MMapFake::getmore(int offset, int *size) const
void *MMapFake::getmore(int offset, int size) const
{
return get(offset, size);
}
@ -477,7 +480,7 @@ void *MMapBuf::get(int offset, int size) const
return (void *) ((char *) m_gb.get() + offset);
}
void *MMapBuf::getmore(int offset, int *size) const
void *MMapBuf::getmore(int offset, int size) const
{
if (m_gb_u)
return m_fm.getmore(offset, size);