diff --git a/example/example-mdbx.c b/example/example-mdbx.c index 0e6148d9..215a0fca 100644 --- a/example/example-mdbx.c +++ b/example/example-mdbx.c @@ -94,8 +94,8 @@ int main(int argc, char *argv[]) { fprintf(stderr, "mdbx_env_create: (%d) %s\n", rc, mdbx_strerror(rc)); goto bailout; } - rc = mdbx_env_open(env, "./example-db", - MDBX_NOSUBDIR | MDBX_COALESCE | MDBX_LIFORECLAIM, 0664); + rc = mdbx_env_open(env, "./example-db", MDBX_NOSUBDIR | MDBX_LIFORECLAIM, + 0664); if (rc != MDBX_SUCCESS) { fprintf(stderr, "mdbx_env_open: (%d) %s\n", rc, mdbx_strerror(rc)); goto bailout; diff --git a/mdbx.h b/mdbx.h index eac303fa..79cf025f 100644 --- a/mdbx.h +++ b/mdbx.h @@ -1327,8 +1327,9 @@ enum MDBX_env_flags_t { * This flag may be changed at any time using `mdbx_env_set_flags()`. */ MDBX_NOMEMINIT = UINT32_C(0x1000000), +#ifndef _MSC_VER /* avoid madness MSVC */ /** Aims to coalesce a Garbage Collection items. - * \note Always enabled since v0.12 + * \deprecated Always enabled since v0.12 and deprecated since v0.13. * * With `MDBX_COALESCE` flag MDBX will aims to coalesce items while recycling * a Garbage Collection. Technically, when possible short lists of pages @@ -1338,7 +1339,8 @@ enum MDBX_env_flags_t { * Unallocated space and reducing the database file. * * This flag may be changed at any time using mdbx_env_set_flags(). */ - MDBX_COALESCE = UINT32_C(0x2000000), + MDBX_COALESCE MDBX_DEPRECATED = UINT32_C(0x2000000), +#endif /* avoid madness MSVC */ /** LIFO policy for recycling a Garbage Collection items. * diff --git a/src/internals.h b/src/internals.h index f5213d85..64bf7355 100644 --- a/src/internals.h +++ b/src/internals.h @@ -1784,8 +1784,8 @@ log2n_powerof2(size_t value_uintptr) { * environment and re-opening it with the new flags. */ #define ENV_CHANGEABLE_FLAGS \ (MDBX_SAFE_NOSYNC | MDBX_NOMETASYNC | MDBX_DEPRECATED_MAPASYNC | \ - MDBX_NOMEMINIT | MDBX_COALESCE | MDBX_PAGEPERTURB | MDBX_ACCEDE | \ - MDBX_VALIDATION) + MDBX_NOMEMINIT | MDBX_DEPRECATED_COALESCE | MDBX_PAGEPERTURB | \ + MDBX_ACCEDE | MDBX_VALIDATION) #define ENV_CHANGELESS_FLAGS \ (MDBX_NOSUBDIR | MDBX_RDONLY | MDBX_WRITEMAP | MDBX_NOSTICKYTHREADS | \ MDBX_NORDAHEAD | MDBX_LIFORECLAIM | MDBX_EXCLUSIVE) diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 51a0f35f..8f4e740d 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -1227,7 +1227,7 @@ env::operate_parameters::make_flags(bool accede, bool use_subdirectory) const { if (options.nested_write_transactions) flags &= ~MDBX_WRITEMAP; if (reclaiming.coalesce) - flags |= MDBX_COALESCE; + flags |= MDBX_env_flags_t(MDBX_DEPRECATED_COALESCE); if (reclaiming.lifo) flags |= MDBX_LIFORECLAIM; switch (durability) { @@ -1272,7 +1272,7 @@ env::durability env::operate_parameters::durability_from_flags( env::reclaiming_options::reclaiming_options(MDBX_env_flags_t flags) noexcept : lifo((flags & MDBX_LIFORECLAIM) ? true : false), - coalesce((flags & MDBX_COALESCE) ? true : false) {} + coalesce((flags & MDBX_DEPRECATED_COALESCE) ? true : false) {} env::operate_options::operate_options(MDBX_env_flags_t flags) noexcept : no_sticky_threads(((flags & (MDBX_NOSTICKYTHREADS | MDBX_EXCLUSIVE)) == diff --git a/test/extra/dupfixed_addodd.c b/test/extra/dupfixed_addodd.c index da9ba944..5b666af9 100644 --- a/test/extra/dupfixed_addodd.c +++ b/test/extra/dupfixed_addodd.c @@ -37,8 +37,8 @@ int main() { exit(EXIT_FAILURE); } - rc = mdbx_env_open(env, "./example-db", - MDBX_NOSUBDIR | MDBX_COALESCE | MDBX_LIFORECLAIM, 0664); + rc = mdbx_env_open(env, "./example-db", MDBX_NOSUBDIR | MDBX_LIFORECLAIM, + 0664); if (rc != MDBX_SUCCESS) { fprintf(stderr, "mdbx_env_open: (%d) %s\n", rc, mdbx_strerror(rc)); exit(EXIT_FAILURE); diff --git a/test/extra/upsert_alldups.c b/test/extra/upsert_alldups.c index 702cdb82..7999f081 100644 --- a/test/extra/upsert_alldups.c +++ b/test/extra/upsert_alldups.c @@ -62,8 +62,7 @@ int main(int argc, const char *argv[]) { errmsg = "failed to mdbx_env_create: %s\n"; goto Fail; } - if ((rc = mdbx_env_open( - env, ".", MDBX_NOSUBDIR | MDBX_COALESCE | MDBX_LIFORECLAIM, 0644))) { + if ((rc = mdbx_env_open(env, ".", MDBX_NOSUBDIR | MDBX_LIFORECLAIM, 0644))) { errmsg = "failed to mdbx_env_open: %s\n"; goto Fail; }