mdbx-posix: use MAP_NORESERVE.

Change-Id: I6a46a5bfa5ed3fa5c3f26775fcba346f71106ad1
This commit is contained in:
Leonid Yuriev 2021-03-17 01:14:52 +03:00
parent 0be7616521
commit 6c9e8817b7
2 changed files with 7 additions and 2 deletions

View File

@ -1070,6 +1070,7 @@ nops
NOQEMU
nordahead
NOREPLACE
NORESERVE
noreturn
nospill
nosubdir

View File

@ -1468,11 +1468,15 @@ MDBX_INTERNAL_FUNC int mdbx_mmap(const int flags, mdbx_mmap_t *map,
#ifndef MAP_FIXED_NOREPLACE
#define MAP_FIXED_NOREPLACE 0
#endif
#ifndef MAP_NORESERVE
#define MAP_NORESERVE 0
#endif
map->address = mmap(
NULL, limit, (flags & MDBX_WRITEMAP) ? PROT_READ | PROT_WRITE : PROT_READ,
MAP_SHARED | MAP_FILE |
MAP_SHARED | MAP_FILE | MAP_NORESERVE |
(F_ISSET(flags, MDBX_UTTERLY_NOSYNC) ? MAP_NOSYNC : 0) |
((options & MMAP_OPTION_SEMAPHORE) ? MAP_HASSEMAPHORE | MAP_NOSYNC
: MAP_CONCEAL),
@ -1738,7 +1742,7 @@ retry_mapview:;
#endif /* MREMAP_MAYMOVE */
const unsigned mmap_flags =
MAP_CONCEAL | MAP_SHARED | MAP_FILE |
MAP_CONCEAL | MAP_SHARED | MAP_FILE | MAP_NORESERVE |
(F_ISSET(flags, MDBX_UTTERLY_NOSYNC) ? MAP_NOSYNC : 0);
const unsigned mmap_prot =
(flags & MDBX_WRITEMAP) ? PROT_READ | PROT_WRITE : PROT_READ;