Update of /cvsroot/nsis/NSIS/Source
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27691
Modified Files:
build.cpp mmap.cpp mmap.h
Log Message:
applied patch #1611866 - Fix MMapFile::release(void *pView, int size)
Index: mmap.cpp
===================================================================
RCS file: /cvsroot/nsis/NSIS/Source/mmap.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** mmap.cpp 28 Oct 2006 19:45:01 -0000 1.5
--- mmap.cpp 9 Dec 2006 15:17:24 -0000 1.6
***************
*** 291,295 ****
}
! void *MMapFile::getmore(int offset, int *size) const
{
void *pView;
--- 291,295 ----
}
! void *MMapFile::getmore(int offset, int size) const
{
void *pView;
***************
*** 325,328 ****
--- 325,331 ----
return;
+ unsigned int alignment = ((unsigned int)pView) % m_iAllocationGranularity;
+ pView = (char *)pView - alignment;
+ size += alignment;
#ifdef _WIN32
UnmapViewOfFile(pView);
***************
*** 375,379 ****
}
! void *MMapFake::getmore(int offset, int *size) const
{
return get(offset, size);
--- 378,382 ----
}
! void *MMapFake::getmore(int offset, int size) const
{
return get(offset, size);
***************
*** 478,482 ****
}
! void *MMapBuf::getmore(int offset, int *size) const
{
if (m_gb_u)
--- 481,485 ----
}
! void *MMapBuf::getmore(int offset, int size) const
{
if (m_gb_u)
Index: build.cpp
===================================================================
RCS file: /cvsroot/nsis/NSIS/Source/build.cpp,v
retrieving revision 1.215
retrieving revision 1.216
diff -C2 -d -r1.215 -r1.216
*** build.cpp 28 Oct 2006 19:45:00 -0000 1.215
--- build.cpp 9 Dec 2006 15:17:24 -0000 1.216
***************
*** 615,625 ****
{
int l = min(left, build_filebuflen);
- int la = l;
void *newstuff = db->get(start_offset + this_len - left, l);
! void *oldstuff = db->getmore(pos + this_len - left, &la);
int res = memcmp(newstuff, oldstuff, l);
! db->release(oldstuff, la);
db->release();
--- 615,624 ----
{
int l = min(left, build_filebuflen);
void *newstuff = db->get(start_offset + this_len - left, l);
! void *oldstuff = db->getmore(pos + this_len - left, l);
int res = memcmp(newstuff, oldstuff, l);
! db->release(oldstuff, l);
db->release();
Index: mmap.h
===================================================================
RCS file: /cvsroot/nsis/NSIS/Source/mmap.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mmap.h 28 Oct 2006 19:45:01 -0000 1.3
--- mmap.h 9 Dec 2006 15:17:24 -0000 1.4
***************
*** 32,36 ****
virtual void *get(int offset, int size) const=0;
virtual void *get(int offset, int *size) const=0;
! virtual void *getmore(int offset, int *size) const=0;
virtual void release()=0;
virtual void release(void *view, int size)=0;
--- 32,36 ----
virtual void *get(int offset, int size) const=0;
virtual void *get(int offset, int *size) const=0;
! virtual void *getmore(int offset, int size) const=0;
virtual void release()=0;
virtual void release(void *view, int size)=0;
***************
*** 62,66 ****
void *get(int offset, int size) const;
void *get(int offset, int *sizep) const;
! void *getmore(int offset, int *size) const;
void release();
void release(void *pView, int size);
--- 62,66 ----
void *get(int offset, int size) const;
void *get(int offset, int *sizep) const;
! void *getmore(int offset, int size) const;
void release();
void release(void *pView, int size);
***************
*** 95,99 ****
void *get(int offset, int size) const;
void *get(int offset, int *size) const;
! void *getmore(int offset, int *size) const;
void resize(int n);
--- 95,99 ----
void *get(int offset, int size) const;
void *get(int offset, int *size) const;
! void *getmore(int offset, int size) const;
void resize(int n);
***************
*** 127,131 ****
void *get(int offset, int *sizep) const;
void *get(int offset, int size) const;
! void *getmore(int offset, int *size) const;
void release();
void release(void *pView, int size);
--- 127,131 ----
void *get(int offset, int *sizep) const;
void *get(int offset, int size) const;
! void *getmore(int offset, int size) const;
void release();
void release(void *pView, int size);
|