mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 06:03:02 +01:00
Backported fix for CORE-3067: Objects not unmapped when shared memory is closed
This commit is contained in:
parent
50b3b15aeb
commit
3ecdb30236
@ -2895,18 +2895,19 @@ void ISC_unmap_object(ISC_STATUS * status_vector,
|
|||||||
/* Get system page size as this is the unit of mapping. */
|
/* Get system page size as this is the unit of mapping. */
|
||||||
|
|
||||||
#ifdef SOLARIS
|
#ifdef SOLARIS
|
||||||
const SLONG page_size = sysconf(_SC_PAGESIZE);
|
const SLONG ps = sysconf(_SC_PAGESIZE);
|
||||||
if (page_size == -1) {
|
if (ps == -1) {
|
||||||
error(status_vector, "sysconf", errno);
|
error(status_vector, "sysconf", errno);
|
||||||
return; // false;
|
return; // false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const SLONG page_size = (int) getpagesize();
|
const SLONG ps = (int) getpagesize();
|
||||||
if (page_size == -1) {
|
if (ps == -1) {
|
||||||
error(status_vector, "getpagesize", errno);
|
error(status_vector, "getpagesize", errno);
|
||||||
return; // false;
|
return; // false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
const size_t page_size = (ULONG) ps;
|
||||||
|
|
||||||
/* Compute the start and end page-aligned addresses which
|
/* Compute the start and end page-aligned addresses which
|
||||||
contain the mapped object. */
|
contain the mapped object. */
|
||||||
@ -2916,7 +2917,7 @@ void ISC_unmap_object(ISC_STATUS * status_vector,
|
|||||||
(UCHAR
|
(UCHAR
|
||||||
*) ((U_IPTR) ((*object_pointer + object_length) +
|
*) ((U_IPTR) ((*object_pointer + object_length) +
|
||||||
(page_size - 1)) & ~(page_size - 1));
|
(page_size - 1)) & ~(page_size - 1));
|
||||||
const SLONG length = end - start;
|
const size_t length = end - start;
|
||||||
|
|
||||||
if (munmap((char *) start, length) == -1) {
|
if (munmap((char *) start, length) == -1) {
|
||||||
error(status_vector, "munmap", errno);
|
error(status_vector, "munmap", errno);
|
||||||
|
Loading…
Reference in New Issue
Block a user