summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/database.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-25 19:51:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-25 19:51:01 +0000
commitd84c40216b5e60224eb365f633b5f142d459fc9e (patch)
treec64402a3813b8c452f8bb80bb9c13bf5b6529e18 /plugins/Db3x_mmap/src/database.cpp
parentf8ad8c89b9b308a79ad1f4081a478338eb504c26 (diff)
merge from branch
git-svn-id: http://svn.miranda-ng.org/main/trunk@8274 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/database.cpp')
-rw-r--r--plugins/Db3x_mmap/src/database.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp
index 723ddea5a7..47b12b2c70 100644
--- a/plugins/Db3x_mmap/src/database.cpp
+++ b/plugins/Db3x_mmap/src/database.cpp
@@ -32,6 +32,8 @@ DWORD CDb3Mmap::CreateNewSpace(int bytes)
{
DWORD ofsNew = m_dbHeader.ofsFileEnd;
m_dbHeader.ofsFileEnd += bytes;
+ if (m_dbHeader.ofsFileEnd > m_dwFileSize)
+ ReMap(m_dbHeader.ofsFileEnd - m_dwFileSize);
DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
log2("newspace %d@%08x", bytes, ofsNew);
return ofsNew;
@@ -65,7 +67,7 @@ DWORD CDb3Mmap::ReallocSpace(DWORD ofs, int oldSize, int newSize)
}
else {
ofsNew = CreateNewSpace(newSize);
- DBMoveChunk(ofsNew,ofs,oldSize);
+ DBMoveChunk(ofsNew, ofs, oldSize);
DeleteSpace(ofs,oldSize);
}
return ofsNew;