mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:04:12 +08:00
mdbx: remove obsolete mlock().
Change-Id: I23df282d545eac9dd7bf9df1bd71dedbccc45cfd
This commit is contained in:
parent
4fa4129add
commit
9e473ab6f2
@ -4219,14 +4219,6 @@ static int __cold mdbx_env_map(MDBX_env *env, size_t usedsize) {
|
|||||||
return errno;
|
return errno;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Lock meta pages to avoid unexpected write,
|
|
||||||
* before the data pages would be synchronized. */
|
|
||||||
if (env->me_flags & MDBX_WRITEMAP) {
|
|
||||||
rc = mdbx_mlock(&env->me_dxb_mmap, pgno2bytes(env, NUM_METAS));
|
|
||||||
if (unlikely(rc != MDBX_SUCCESS))
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_VALGRIND
|
#ifdef USE_VALGRIND
|
||||||
env->me_valgrind_handle =
|
env->me_valgrind_handle =
|
||||||
VALGRIND_CREATE_BLOCK(env->me_map, env->me_mapsize, "mdbx");
|
VALGRIND_CREATE_BLOCK(env->me_map, env->me_mapsize, "mdbx");
|
||||||
|
@ -930,14 +930,6 @@ int mdbx_munmap(mdbx_mmap_t *map) {
|
|||||||
return MDBX_SUCCESS;
|
return MDBX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mdbx_mlock(mdbx_mmap_t *map, size_t length) {
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
|
||||||
return VirtualLock(map->address, length) ? MDBX_SUCCESS : GetLastError();
|
|
||||||
#else
|
|
||||||
return (mlock(map->address, length) == 0) ? MDBX_SUCCESS : errno;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t must, size_t limit) {
|
int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t must, size_t limit) {
|
||||||
assert(must <= limit);
|
assert(must <= limit);
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* https://en.wikipedia.org/wiki/Operating_system_abstraction_layer */
|
/* https://en.wikipedia.org/wiki/Operating_system_abstraction_layer */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2015-2017 Leonid Yuriev <leo@yuriev.ru>
|
* Copyright 2015-2017 Leonid Yuriev <leo@yuriev.ru>
|
||||||
@ -455,7 +455,6 @@ typedef struct mdbx_mmap_param {
|
|||||||
|
|
||||||
int mdbx_mmap(int flags, mdbx_mmap_t *map, size_t must, size_t limit);
|
int mdbx_mmap(int flags, mdbx_mmap_t *map, size_t must, size_t limit);
|
||||||
int mdbx_munmap(mdbx_mmap_t *map);
|
int mdbx_munmap(mdbx_mmap_t *map);
|
||||||
int mdbx_mlock(mdbx_mmap_t *map, size_t length);
|
|
||||||
int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t current, size_t wanna);
|
int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t current, size_t wanna);
|
||||||
int mdbx_msync(mdbx_mmap_t *map, size_t offset, size_t length, int async);
|
int mdbx_msync(mdbx_mmap_t *map, size_t offset, size_t length, int async);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user