Skip to content

Commit

Permalink
mdbx_v0.12.5 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Apr 23, 2023
1 parent 8f3aea7 commit 242afea
Show file tree
Hide file tree
Showing 10 changed files with 579 additions and 500 deletions.
471 changes: 243 additions & 228 deletions mdbx/mdbx.c

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions mdbx/mdbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,9 @@ LIBMDBX_API const char *mdbx_strerror_r_ANSI2OEM(int errnum, char *buf,
* \returns a non-zero error value on failure and 0 on success. */
LIBMDBX_API int mdbx_env_create(MDBX_env **penv);

/** \brief MDBX environment options. */
/** \brief MDBX environment extra runtime options.
* \ingroup c_settings
* \see mdbx_env_set_option() \see mdbx_env_get_option() */
enum MDBX_option_t {
/** \brief Controls the maximum number of named databases for the environment.
*
Expand Down Expand Up @@ -2268,7 +2270,7 @@ enum MDBX_option_t {
typedef enum MDBX_option_t MDBX_option_t;
#endif

/** \brief Sets the value of a runtime options for an environment.
/** \brief Sets the value of a extra runtime options for an environment.
* \ingroup c_settings
*
* \param [in] env An environment handle returned by \ref mdbx_env_create().
Expand All @@ -2281,7 +2283,7 @@ typedef enum MDBX_option_t MDBX_option_t;
LIBMDBX_API int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option,
uint64_t value);

/** \brief Gets the value of runtime options from an environment.
/** \brief Gets the value of extra runtime options from an environment.
* \ingroup c_settings
*
* \param [in] env An environment handle returned by \ref mdbx_env_create().
Expand Down Expand Up @@ -3055,6 +3057,8 @@ LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd);
* it is reasonable to know some details in order to make optimal decisions
* when choosing parameters.
*
* \see mdbx_env_info_ex()
*
* Both \ref mdbx_env_set_geometry() and legacy \ref mdbx_env_set_mapsize() are
* inapplicable to read-only opened environment.
*
Expand Down Expand Up @@ -3164,7 +3168,7 @@ LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd);
* \note Actual values may be different than your have specified because of
* rounding to specified database page size, the system page size and/or the
* size of the system virtual memory management unit. You can get actual values
* by \ref mdbx_env_sync_ex() or see by using the tool `mdbx_chk` with the `-v`
* by \ref mdbx_env_info_ex() or see by using the tool `mdbx_chk` with the `-v`
* option.
*
* Legacy \ref mdbx_env_set_mapsize() correspond to calling
Expand Down
471 changes: 243 additions & 228 deletions mdbxdist/mdbx.c

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions mdbxdist/mdbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,9 @@ LIBMDBX_API const char *mdbx_strerror_r_ANSI2OEM(int errnum, char *buf,
* \returns a non-zero error value on failure and 0 on success. */
LIBMDBX_API int mdbx_env_create(MDBX_env **penv);

/** \brief MDBX environment options. */
/** \brief MDBX environment extra runtime options.
* \ingroup c_settings
* \see mdbx_env_set_option() \see mdbx_env_get_option() */
enum MDBX_option_t {
/** \brief Controls the maximum number of named databases for the environment.
*
Expand Down Expand Up @@ -2268,7 +2270,7 @@ enum MDBX_option_t {
typedef enum MDBX_option_t MDBX_option_t;
#endif

/** \brief Sets the value of a runtime options for an environment.
/** \brief Sets the value of a extra runtime options for an environment.
* \ingroup c_settings
*
* \param [in] env An environment handle returned by \ref mdbx_env_create().
Expand All @@ -2281,7 +2283,7 @@ typedef enum MDBX_option_t MDBX_option_t;
LIBMDBX_API int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option,
uint64_t value);

/** \brief Gets the value of runtime options from an environment.
/** \brief Gets the value of extra runtime options from an environment.
* \ingroup c_settings
*
* \param [in] env An environment handle returned by \ref mdbx_env_create().
Expand Down Expand Up @@ -3055,6 +3057,8 @@ LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd);
* it is reasonable to know some details in order to make optimal decisions
* when choosing parameters.
*
* \see mdbx_env_info_ex()
*
* Both \ref mdbx_env_set_geometry() and legacy \ref mdbx_env_set_mapsize() are
* inapplicable to read-only opened environment.
*
Expand Down Expand Up @@ -3164,7 +3168,7 @@ LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd);
* \note Actual values may be different than your have specified because of
* rounding to specified database page size, the system page size and/or the
* size of the system virtual memory management unit. You can get actual values
* by \ref mdbx_env_sync_ex() or see by using the tool `mdbx_chk` with the `-v`
* by \ref mdbx_env_info_ex() or see by using the tool `mdbx_chk` with the `-v`
* option.
*
* Legacy \ref mdbx_env_set_mapsize() correspond to calling
Expand Down
17 changes: 11 additions & 6 deletions mdbxdist/mdbx_chk.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */

#define MDBX_BUILD_SOURCERY 5777e7cda5ce7601d3d4f997c2d985538a3a61e6b6e02682cca2137e05e756cb_v0_12_3_30_g29d12f1f
#define MDBX_BUILD_SOURCERY 3bd4ed05bd2736470da2556602a105008d8b53012d792b77aefd32d0baeb533b_v0_12_5_0_g9b829145
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
Expand Down Expand Up @@ -830,14 +830,19 @@ __extern_C key_t ftok(const char *, int);
#endif
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

#if MDBX_GOOFY_MSVC_STATIC_ANALYZER
#if MDBX_GOOFY_MSVC_STATIC_ANALYZER || (defined(_MSC_VER) && _MSC_VER > 1919)
#define MDBX_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note) \
_Pragma(MDBX_STRINGIFY(prefast(suppress : warn_id)))
#ifdef _PREFAST_
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(prefast(suppress : warn_id))
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(warning(suppress : warn_id))
#endif
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id)
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

/*----------------------------------------------------------------------------*/

Expand Down
17 changes: 11 additions & 6 deletions mdbxdist/mdbx_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */

#define MDBX_BUILD_SOURCERY 5777e7cda5ce7601d3d4f997c2d985538a3a61e6b6e02682cca2137e05e756cb_v0_12_3_30_g29d12f1f
#define MDBX_BUILD_SOURCERY 3bd4ed05bd2736470da2556602a105008d8b53012d792b77aefd32d0baeb533b_v0_12_5_0_g9b829145
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
Expand Down Expand Up @@ -830,14 +830,19 @@ __extern_C key_t ftok(const char *, int);
#endif
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

#if MDBX_GOOFY_MSVC_STATIC_ANALYZER
#if MDBX_GOOFY_MSVC_STATIC_ANALYZER || (defined(_MSC_VER) && _MSC_VER > 1919)
#define MDBX_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note) \
_Pragma(MDBX_STRINGIFY(prefast(suppress : warn_id)))
#ifdef _PREFAST_
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(prefast(suppress : warn_id))
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(warning(suppress : warn_id))
#endif
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id)
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

/*----------------------------------------------------------------------------*/

Expand Down
17 changes: 11 additions & 6 deletions mdbxdist/mdbx_drop.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */

#define MDBX_BUILD_SOURCERY 5777e7cda5ce7601d3d4f997c2d985538a3a61e6b6e02682cca2137e05e756cb_v0_12_3_30_g29d12f1f
#define MDBX_BUILD_SOURCERY 3bd4ed05bd2736470da2556602a105008d8b53012d792b77aefd32d0baeb533b_v0_12_5_0_g9b829145
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
Expand Down Expand Up @@ -832,14 +832,19 @@ __extern_C key_t ftok(const char *, int);
#endif
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

#if MDBX_GOOFY_MSVC_STATIC_ANALYZER
#if MDBX_GOOFY_MSVC_STATIC_ANALYZER || (defined(_MSC_VER) && _MSC_VER > 1919)
#define MDBX_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note) \
_Pragma(MDBX_STRINGIFY(prefast(suppress : warn_id)))
#ifdef _PREFAST_
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(prefast(suppress : warn_id))
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(warning(suppress : warn_id))
#endif
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id)
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

/*----------------------------------------------------------------------------*/

Expand Down
17 changes: 11 additions & 6 deletions mdbxdist/mdbx_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */

#define MDBX_BUILD_SOURCERY 5777e7cda5ce7601d3d4f997c2d985538a3a61e6b6e02682cca2137e05e756cb_v0_12_3_30_g29d12f1f
#define MDBX_BUILD_SOURCERY 3bd4ed05bd2736470da2556602a105008d8b53012d792b77aefd32d0baeb533b_v0_12_5_0_g9b829145
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
Expand Down Expand Up @@ -830,14 +830,19 @@ __extern_C key_t ftok(const char *, int);
#endif
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

#if MDBX_GOOFY_MSVC_STATIC_ANALYZER
#if MDBX_GOOFY_MSVC_STATIC_ANALYZER || (defined(_MSC_VER) && _MSC_VER > 1919)
#define MDBX_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note) \
_Pragma(MDBX_STRINGIFY(prefast(suppress : warn_id)))
#ifdef _PREFAST_
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(prefast(suppress : warn_id))
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(warning(suppress : warn_id))
#endif
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id)
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

/*----------------------------------------------------------------------------*/

Expand Down
17 changes: 11 additions & 6 deletions mdbxdist/mdbx_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */

#define MDBX_BUILD_SOURCERY 5777e7cda5ce7601d3d4f997c2d985538a3a61e6b6e02682cca2137e05e756cb_v0_12_3_30_g29d12f1f
#define MDBX_BUILD_SOURCERY 3bd4ed05bd2736470da2556602a105008d8b53012d792b77aefd32d0baeb533b_v0_12_5_0_g9b829145
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
Expand Down Expand Up @@ -830,14 +830,19 @@ __extern_C key_t ftok(const char *, int);
#endif
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

#if MDBX_GOOFY_MSVC_STATIC_ANALYZER
#if MDBX_GOOFY_MSVC_STATIC_ANALYZER || (defined(_MSC_VER) && _MSC_VER > 1919)
#define MDBX_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note) \
_Pragma(MDBX_STRINGIFY(prefast(suppress : warn_id)))
#ifdef _PREFAST_
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(prefast(suppress : warn_id))
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(warning(suppress : warn_id))
#endif
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id)
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

/*----------------------------------------------------------------------------*/

Expand Down
28 changes: 22 additions & 6 deletions mdbxdist/mdbx_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */

#define MDBX_BUILD_SOURCERY 5777e7cda5ce7601d3d4f997c2d985538a3a61e6b6e02682cca2137e05e756cb_v0_12_3_30_g29d12f1f
#define MDBX_BUILD_SOURCERY 3bd4ed05bd2736470da2556602a105008d8b53012d792b77aefd32d0baeb533b_v0_12_5_0_g9b829145
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
Expand Down Expand Up @@ -830,14 +830,19 @@ __extern_C key_t ftok(const char *, int);
#endif
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

#if MDBX_GOOFY_MSVC_STATIC_ANALYZER
#if MDBX_GOOFY_MSVC_STATIC_ANALYZER || (defined(_MSC_VER) && _MSC_VER > 1919)
#define MDBX_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note) \
_Pragma(MDBX_STRINGIFY(prefast(suppress : warn_id)))
#ifdef _PREFAST_
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(prefast(suppress : warn_id))
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id, note)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id) \
__pragma(warning(suppress : warn_id))
#endif
#else
#define MDBX_ANALYSIS_ASSUME(expr) assert(expr)
#define MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(warn_id)
#endif /* MDBX_GOOFY_MSVC_STATIC_ANALYZER */

/*----------------------------------------------------------------------------*/

Expand Down Expand Up @@ -4372,6 +4377,17 @@ int main(int argc, char *argv[]) {
printf(" WOP: %8" PRIu64
"\t// number of explicit write operations (not a pages) to a disk\n",
mei.mi_pgop_stat.wops);
printf(" PreFault: %8" PRIu64
"\t// number of prefault write operations (not a pages)\n",
mei.mi_pgop_stat.prefault);
printf(" mInCore: %8" PRIu64 "\t// number of mincore() calls\n",
mei.mi_pgop_stat.mincore);
printf(" mSync: %8" PRIu64
"\t// number of explicit msync-to-disk operations (not a pages)\n",
mei.mi_pgop_stat.msync);
printf(" fSync: %8" PRIu64
"\t// number of explicit fsync-to-disk operations (not a pages)\n",
mei.mi_pgop_stat.fsync);
}

if (envinfo) {
Expand Down

0 comments on commit 242afea

Please sign in to comment.