mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx-posix: use MAP_NORESERVE
.
Change-Id: I6a46a5bfa5ed3fa5c3f26775fcba346f71106ad1
This commit is contained in:
parent
0be7616521
commit
6c9e8817b7
1
.github/actions/spelling/expect.txt
vendored
1
.github/actions/spelling/expect.txt
vendored
@ -1070,6 +1070,7 @@ nops
|
||||
NOQEMU
|
||||
nordahead
|
||||
NOREPLACE
|
||||
NORESERVE
|
||||
noreturn
|
||||
nospill
|
||||
nosubdir
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user