8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 06:03:02 +01:00

Fixed server crash during memory remapping.

This commit is contained in:
dimitr 2008-03-18 11:34:50 +00:00
parent a2d6d1fbfa
commit 83cebeea26

View File

@ -1111,6 +1111,7 @@ static UCHAR* alloc(SSHORT size, ISC_STATUS* status_vector)
#endif
)
{
const bool extend = (LOCK_header->lhb_used > LOCK_header->lhb_length);
LOCK_header->lhb_used -= size;
#if (defined HAVE_MMAP || defined WIN_NT)
@ -1119,7 +1120,7 @@ static UCHAR* alloc(SSHORT size, ISC_STATUS* status_vector)
remap_local_owners();
// Remap the shared memory region
const ULONG length = LOCK_data.sh_mem_length_mapped +
(LOCK_header->lhb_used > LOCK_header->lhb_length) ? Config::getLockMemSize() : 0;
(extend ? Config::getLockMemSize() : 0);
lhb* header = (lhb*) ISC_remap_file(status_vector, &LOCK_data, length, true);
if (header) {
LOCK_header = header;