mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:44:13 +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
|
NOQEMU
|
||||||
nordahead
|
nordahead
|
||||||
NOREPLACE
|
NOREPLACE
|
||||||
|
NORESERVE
|
||||||
noreturn
|
noreturn
|
||||||
nospill
|
nospill
|
||||||
nosubdir
|
nosubdir
|
||||||
|
@ -1468,11 +1468,15 @@ MDBX_INTERNAL_FUNC int mdbx_mmap(const int flags, mdbx_mmap_t *map,
|
|||||||
|
|
||||||
#ifndef MAP_FIXED_NOREPLACE
|
#ifndef MAP_FIXED_NOREPLACE
|
||||||
#define MAP_FIXED_NOREPLACE 0
|
#define MAP_FIXED_NOREPLACE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MAP_NORESERVE
|
||||||
|
#define MAP_NORESERVE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
map->address = mmap(
|
map->address = mmap(
|
||||||
NULL, limit, (flags & MDBX_WRITEMAP) ? PROT_READ | PROT_WRITE : PROT_READ,
|
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) |
|
(F_ISSET(flags, MDBX_UTTERLY_NOSYNC) ? MAP_NOSYNC : 0) |
|
||||||
((options & MMAP_OPTION_SEMAPHORE) ? MAP_HASSEMAPHORE | MAP_NOSYNC
|
((options & MMAP_OPTION_SEMAPHORE) ? MAP_HASSEMAPHORE | MAP_NOSYNC
|
||||||
: MAP_CONCEAL),
|
: MAP_CONCEAL),
|
||||||
@ -1738,7 +1742,7 @@ retry_mapview:;
|
|||||||
#endif /* MREMAP_MAYMOVE */
|
#endif /* MREMAP_MAYMOVE */
|
||||||
|
|
||||||
const unsigned mmap_flags =
|
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);
|
(F_ISSET(flags, MDBX_UTTERLY_NOSYNC) ? MAP_NOSYNC : 0);
|
||||||
const unsigned mmap_prot =
|
const unsigned mmap_prot =
|
||||||
(flags & MDBX_WRITEMAP) ? PROT_READ | PROT_WRITE : PROT_READ;
|
(flags & MDBX_WRITEMAP) ? PROT_READ | PROT_WRITE : PROT_READ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user