diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-07 19:46:11 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-07 19:46:11 +0300 |
commit | 5c4715aea7dc5bda704924448d2d74380f75c0b0 (patch) | |
tree | bdff3c35d07634b67efe9ab8514b761ad6c2a565 /libs/libmdbx | |
parent | 3c7699f80c5c4b8be13731c36d4deb4c6cc8eefe (diff) |
fixes #2205 (Unable to create new profile)
Diffstat (limited to 'libs/libmdbx')
-rw-r--r-- | libs/libmdbx/src/README.md | 3 | ||||
-rw-r--r-- | libs/libmdbx/src/mdbx.h | 3 | ||||
-rw-r--r-- | libs/libmdbx/src/src/elements/core.c | 28 |
3 files changed, 19 insertions, 15 deletions
diff --git a/libs/libmdbx/src/README.md b/libs/libmdbx/src/README.md index 1b2fb69bdd..d5c24f5545 100644 --- a/libs/libmdbx/src/README.md +++ b/libs/libmdbx/src/README.md @@ -1,3 +1,5 @@ +<!-- Required extensions: pymdownx.betterem, pymdownx.tilde, pymdownx.emoji, pymdownx.tasklist, pymdownx.superfences --> + libmdbx ======= @@ -554,4 +556,3 @@ syscall and by scanning data directory. -------------------------------------------------------------------------------- ### The [repository now only mirrored on the Github](https://abf.io/erthink/libmdbx) due to illegal discriminatory restrictions for Russian Crimea and for sovereign crimeans. -<!-- Required extensions: pymdownx.betterem, pymdownx.tilde, pymdownx.emoji, pymdownx.tasklist, pymdownx.superfences --> diff --git a/libs/libmdbx/src/mdbx.h b/libs/libmdbx/src/mdbx.h index fba8c4602b..8c9c865129 100644 --- a/libs/libmdbx/src/mdbx.h +++ b/libs/libmdbx/src/mdbx.h @@ -1508,8 +1508,7 @@ typedef enum MDBX_cursor_op { * since it opened in read-only mode */ #define MDBX_WANNA_RECOVERY (-30419) -/* The given key value is mismatched to the current cursor position, - * when mdbx_cursor_put() called with MDBX_CURRENT option. */ +/* The given key value is mismatched to the current cursor position */ #define MDBX_EKEYMISMATCH (-30418) /* Database is too large for current system, diff --git a/libs/libmdbx/src/src/elements/core.c b/libs/libmdbx/src/src/elements/core.c index d1cf8979ae..306ce6bc3b 100644 --- a/libs/libmdbx/src/src/elements/core.c +++ b/libs/libmdbx/src/src/elements/core.c @@ -2493,13 +2493,13 @@ static int lcklist_detach_locked(MDBX_env *env) { TYPE_LIST *const begin = first, *const end = begin + length; \ \ while (length > 3) { \ - const unsigned half = length >> 1; \ - TYPE_LIST *const middle = first + half; \ + const unsigned whole = length; \ + length >>= 1; \ + TYPE_LIST *const middle = first + length; \ if (CMP(*middle, item)) { \ first = middle + 1; \ - length -= half + 1; \ - } else \ - length = half; \ + length = whole - length - 1; \ + } \ } \ \ switch (length) { \ @@ -2507,17 +2507,21 @@ static int lcklist_detach_locked(MDBX_env *env) { if (!CMP(*first, item)) \ break; \ ++first; \ - /* fall through */ \ - __fallthrough; \ + __fallthrough /* fall through */; \ case 2: \ if (!CMP(*first, item)) \ break; \ ++first; \ - /* fall through */ \ - __fallthrough; \ + __fallthrough /* fall through */; \ case 1: \ - if (CMP(*first, item)) \ - ++first; \ + if (!CMP(*first, item)) \ + break; \ + ++first; \ + __fallthrough /* fall through */; \ + case 0: \ + break; \ + default: \ + __unreachable(); \ } \ \ if (mdbx_audit_enabled()) { \ @@ -3176,7 +3180,7 @@ static const char *__mdbx_strerr(int errnum) { "MDBX_VERSION_MISMATCH: DB version mismatch libmdbx", "MDBX_INVALID: File is not an MDBX file", "MDBX_MAP_FULL: Environment mapsize limit reached", - "MDBX_DBS_FULL: Too may DBI-handles (maxdbs reached)", + "MDBX_DBS_FULL: Too many DBI-handles (maxdbs reached)", "MDBX_READERS_FULL: Too many readers (maxreaders reached)", NULL /* MDBX_TLS_FULL (-30789): unused in MDBX */, "MDBX_TXN_FULL: Transaction has too many dirty pages," |