mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 16:24:12 +08:00
mdbx: minor flags cleanup.
Change-Id: I6ebb0d76963c0bf41051ca97fba4ec6f564519e2
This commit is contained in:
parent
3df7c4b1e1
commit
efda814f7e
2
lmdb.h
2
lmdb.h
@ -282,7 +282,7 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel
|
|||||||
/** tie reader locktable slots to #MDB_txn objects instead of to threads */
|
/** tie reader locktable slots to #MDB_txn objects instead of to threads */
|
||||||
#define MDB_NOTLS 0x200000
|
#define MDB_NOTLS 0x200000
|
||||||
/** don't do any locking, caller must manage their own locks
|
/** don't do any locking, caller must manage their own locks
|
||||||
* WARNING: ReOpenLDAP don't support this mode. */
|
* WARNING: MDBX and ReOpenLDAP don't support this mode. */
|
||||||
#define MDB_NOLOCK__UNSUPPORTED 0x400000
|
#define MDB_NOLOCK__UNSUPPORTED 0x400000
|
||||||
/** don't do readahead */
|
/** don't do readahead */
|
||||||
#define MDB_NORDAHEAD 0x800000
|
#define MDB_NORDAHEAD 0x800000
|
||||||
|
5
mdb.c
5
mdb.c
@ -4830,8 +4830,9 @@ mdbx_env_open_ex(MDB_env *env, const char *path, unsigned flags, mode_t mode, in
|
|||||||
rc = MDB_SUCCESS;
|
rc = MDB_SUCCESS;
|
||||||
flags |= env->me_flags;
|
flags |= env->me_flags;
|
||||||
if (flags & MDB_RDONLY) {
|
if (flags & MDB_RDONLY) {
|
||||||
/* silently ignore irrelevant flags when we're only getting read access */
|
/* LY: silently ignore irrelevant flags when we're only getting read access */
|
||||||
flags &= ~(MDB_WRITEMAP | MDB_MAPASYNC | MDB_NOSYNC | MDB_NOMETASYNC);
|
flags &= ~(MDB_WRITEMAP | MDB_MAPASYNC | MDB_NOSYNC | MDB_NOMETASYNC
|
||||||
|
| MDB_COALESCE | MDB_LIFORECLAIM | MDB_NOMEMINIT);
|
||||||
} else {
|
} else {
|
||||||
if (!((env->me_free_pgs = mdb_midl_alloc(MDB_IDL_UM_MAX)) &&
|
if (!((env->me_free_pgs = mdb_midl_alloc(MDB_IDL_UM_MAX)) &&
|
||||||
(env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2)))))
|
(env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user