From 75a4463811114533ccd6e11a7d744f94ff9b1b6b Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 25 Sep 2020 01:21:45 +0300 Subject: [PATCH] mdbx: minor misc cosmetics & refines. Change-Id: I84b70aeded047ab3786a57c864dbc89364969afa --- src/core.c | 10 +++++----- src/mdbx_chk.c | 2 +- src/mdbx_stat.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core.c b/src/core.c index 4cca060e..a979601c 100644 --- a/src/core.c +++ b/src/core.c @@ -15926,7 +15926,7 @@ int mdbx_put(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data, #ifndef MDBX_WBUF #define MDBX_WBUF ((size_t)1024 * 1024) #endif -#define MDBX_EOF 0x10 /* mdbx_env_copyfd1() is done reading */ +#define MDBX_EOF 0x10 /* mdbx_env_copythr() is done reading */ /* State needed for a double-buffering compacting copy. */ typedef struct mdbx_copy { @@ -17551,7 +17551,7 @@ int __cold mdbx_reader_list(const MDBX_env *env, MDBX_reader_list_func *func, /* Insert pid into list if not already present. * return -1 if already present. */ -static int __cold mdbx_pid_insert(uint32_t *ids, uint32_t pid) { +static bool __cold mdbx_pid_insert(uint32_t *ids, uint32_t pid) { /* binary search of pid in list */ unsigned base = 0; unsigned cursor = 1; @@ -17570,7 +17570,7 @@ static int __cold mdbx_pid_insert(uint32_t *ids, uint32_t pid) { n -= pivot + 1; } else { /* found, so it's a duplicate */ - return -1; + return false; } } @@ -17581,7 +17581,7 @@ static int __cold mdbx_pid_insert(uint32_t *ids, uint32_t pid) { for (n = ids[0]; n > cursor; n--) ids[n] = ids[n - 1]; ids[n] = pid; - return 0; + return true; } int __cold mdbx_reader_check(MDBX_env *env, int *dead) { @@ -17627,7 +17627,7 @@ MDBX_INTERNAL_FUNC int __cold mdbx_reader_check0(MDBX_env *env, int rdt_locked, continue /* skip empty */; if (pid == env->me_pid) continue /* skip self */; - if (mdbx_pid_insert(pids, pid) != 0) + if (!mdbx_pid_insert(pids, pid)) continue /* such pid already processed */; int err = mdbx_rpid_check(env, pid); diff --git a/src/mdbx_chk.c b/src/mdbx_chk.c index e4a158d6..1ed6c144 100644 --- a/src/mdbx_chk.c +++ b/src/mdbx_chk.c @@ -703,7 +703,7 @@ static int process_db(MDBX_dbi dbi_handle, char *dbi_name, visitor *handler, } if (!silent && verbose) { - print(" - kind: %s => %s", db_flags2keymode(flags), + print(" - key-value kind: %s => %s", db_flags2keymode(flags), db_flags2valuemode(flags)); if (verbose > 1) { print(", flags:"); diff --git a/src/mdbx_stat.c b/src/mdbx_stat.c index f31a30cf..fcd34227 100644 --- a/src/mdbx_stat.c +++ b/src/mdbx_stat.c @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) { printf(" GC: %" PRIu64 " %.1f%%\n", value, value / percent); value = pages - reclaimable; - printf(" Detained: %" PRIu64 " %.1f%%\n", value, value / percent); + printf(" Retained: %" PRIu64 " %.1f%%\n", value, value / percent); value = reclaimable; printf(" Reclaimable: %" PRIu64 " %.1f%%\n", value, value / percent);