mdbx: использование const MDBX_txn где это возможно в API.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-10-14 09:04:06 +03:00
parent 0e4c6d61a4
commit 04511a7a99
3 changed files with 42 additions and 39 deletions

26
mdbx.h
View File

@ -4291,8 +4291,8 @@ mdbx_int64_from_key(const MDBX_val);
* \retval MDBX_THREAD_MISMATCH Given transaction is not owned * \retval MDBX_THREAD_MISMATCH Given transaction is not owned
* by current thread. * by current thread.
* \retval MDBX_EINVAL An invalid parameter was specified. */ * \retval MDBX_EINVAL An invalid parameter was specified. */
LIBMDBX_API int mdbx_dbi_stat(MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *stat, LIBMDBX_API int mdbx_dbi_stat(const MDBX_txn *txn, MDBX_dbi dbi,
size_t bytes); MDBX_stat *stat, size_t bytes);
/** \brief Retrieve depth (bitmask) information of nested dupsort (multi-value) /** \brief Retrieve depth (bitmask) information of nested dupsort (multi-value)
* B+trees for given database. * B+trees for given database.
@ -4309,7 +4309,7 @@ LIBMDBX_API int mdbx_dbi_stat(MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *stat,
* by current thread. * by current thread.
* \retval MDBX_EINVAL An invalid parameter was specified. * \retval MDBX_EINVAL An invalid parameter was specified.
* \retval MDBX_RESULT_TRUE The dbi isn't a dupsort (multi-value) database. */ * \retval MDBX_RESULT_TRUE The dbi isn't a dupsort (multi-value) database. */
LIBMDBX_API int mdbx_dbi_dupsort_depthmask(MDBX_txn *txn, MDBX_dbi dbi, LIBMDBX_API int mdbx_dbi_dupsort_depthmask(const MDBX_txn *txn, MDBX_dbi dbi,
uint32_t *mask); uint32_t *mask);
/** \brief DBI state bits returted by \ref mdbx_dbi_flags_ex() /** \brief DBI state bits returted by \ref mdbx_dbi_flags_ex()
@ -4341,13 +4341,13 @@ DEFINE_ENUM_FLAG_OPERATORS(MDBX_dbi_state_t)
* \param [out] state Address where the state will be returned. * \param [out] state Address where the state will be returned.
* *
* \returns A non-zero error value on failure and 0 on success. */ * \returns A non-zero error value on failure and 0 on success. */
LIBMDBX_API int mdbx_dbi_flags_ex(MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags, LIBMDBX_API int mdbx_dbi_flags_ex(const MDBX_txn *txn, MDBX_dbi dbi,
unsigned *state); unsigned *flags, unsigned *state);
/** \brief The shortcut to calling \ref mdbx_dbi_flags_ex() with `state=NULL` /** \brief The shortcut to calling \ref mdbx_dbi_flags_ex() with `state=NULL`
* for discarding it result. * for discarding it result.
* \ingroup c_statinfo */ * \ingroup c_statinfo */
LIBMDBX_INLINE_API(int, mdbx_dbi_flags, LIBMDBX_INLINE_API(int, mdbx_dbi_flags,
(MDBX_txn * txn, MDBX_dbi dbi, unsigned *flags)) { (const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags)) {
unsigned state; unsigned state;
return mdbx_dbi_flags_ex(txn, dbi, flags, &state); return mdbx_dbi_flags_ex(txn, dbi, flags, &state);
} }
@ -4423,7 +4423,7 @@ LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del);
* by current thread. * by current thread.
* \retval MDBX_NOTFOUND The key was not in the database. * \retval MDBX_NOTFOUND The key was not in the database.
* \retval MDBX_EINVAL An invalid parameter was specified. */ * \retval MDBX_EINVAL An invalid parameter was specified. */
LIBMDBX_API int mdbx_get(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, LIBMDBX_API int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
MDBX_val *data); MDBX_val *data);
/** \brief Get items from a database /** \brief Get items from a database
@ -4456,7 +4456,7 @@ LIBMDBX_API int mdbx_get(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
* by current thread. * by current thread.
* \retval MDBX_NOTFOUND The key was not in the database. * \retval MDBX_NOTFOUND The key was not in the database.
* \retval MDBX_EINVAL An invalid parameter was specified. */ * \retval MDBX_EINVAL An invalid parameter was specified. */
LIBMDBX_API int mdbx_get_ex(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, LIBMDBX_API int mdbx_get_ex(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key,
MDBX_val *data, size_t *values_count); MDBX_val *data, size_t *values_count);
/** \brief Get equal or great item from a database. /** \brief Get equal or great item from a database.
@ -4487,7 +4487,7 @@ LIBMDBX_API int mdbx_get_ex(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key,
* by current thread. * by current thread.
* \retval MDBX_NOTFOUND The key was not in the database. * \retval MDBX_NOTFOUND The key was not in the database.
* \retval MDBX_EINVAL An invalid parameter was specified. */ * \retval MDBX_EINVAL An invalid parameter was specified. */
LIBMDBX_API int mdbx_get_equal_or_great(MDBX_txn *txn, MDBX_dbi dbi, LIBMDBX_API int mdbx_get_equal_or_great(const MDBX_txn *txn, MDBX_dbi dbi,
MDBX_val *key, MDBX_val *data); MDBX_val *key, MDBX_val *data);
/** \brief Store items into a database. /** \brief Store items into a database.
@ -4729,7 +4729,7 @@ mdbx_cursor_get_userctx(const MDBX_cursor *cursor);
* \retval MDBX_THREAD_MISMATCH Given transaction is not owned * \retval MDBX_THREAD_MISMATCH Given transaction is not owned
* by current thread. * by current thread.
* \retval MDBX_EINVAL An invalid parameter was specified. */ * \retval MDBX_EINVAL An invalid parameter was specified. */
LIBMDBX_API int mdbx_cursor_bind(MDBX_txn *txn, MDBX_cursor *cursor, LIBMDBX_API int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *cursor,
MDBX_dbi dbi); MDBX_dbi dbi);
/** \brief Unbind cursor from a transaction. /** \brief Unbind cursor from a transaction.
@ -4784,7 +4784,7 @@ LIBMDBX_API int mdbx_cursor_unbind(MDBX_cursor *cursor);
* \retval MDBX_THREAD_MISMATCH Given transaction is not owned * \retval MDBX_THREAD_MISMATCH Given transaction is not owned
* by current thread. * by current thread.
* \retval MDBX_EINVAL An invalid parameter was specified. */ * \retval MDBX_EINVAL An invalid parameter was specified. */
LIBMDBX_API int mdbx_cursor_open(MDBX_txn *txn, MDBX_dbi dbi, LIBMDBX_API int mdbx_cursor_open(const MDBX_txn *txn, MDBX_dbi dbi,
MDBX_cursor **cursor); MDBX_cursor **cursor);
/** \brief Close a cursor handle. /** \brief Close a cursor handle.
@ -4848,7 +4848,7 @@ LIBMDBX_API int mdbx_txn_release_all_cursors(const MDBX_txn *txn, bool unbind);
* \retval MDBX_EINVAL An invalid parameter was specified. * \retval MDBX_EINVAL An invalid parameter was specified.
* \retval MDBX_BAD_DBI The cursor was not bound to a DBI-handle * \retval MDBX_BAD_DBI The cursor was not bound to a DBI-handle
* or such a handle became invalid. */ * or such a handle became invalid. */
LIBMDBX_API int mdbx_cursor_renew(MDBX_txn *txn, MDBX_cursor *cursor); LIBMDBX_API int mdbx_cursor_renew(const MDBX_txn *txn, MDBX_cursor *cursor);
/** \brief Return the cursor's transaction handle. /** \brief Return the cursor's transaction handle.
* \ingroup c_cursors * \ingroup c_cursors
@ -5227,7 +5227,7 @@ LIBMDBX_API int mdbx_estimate_move(const MDBX_cursor *cursor, MDBX_val *key,
* \param [out] distance_items A pointer to store range estimation result. * \param [out] distance_items A pointer to store range estimation result.
* *
* \returns A non-zero error value on failure and 0 on success. */ * \returns A non-zero error value on failure and 0 on success. */
LIBMDBX_API int mdbx_estimate_range(MDBX_txn *txn, MDBX_dbi dbi, LIBMDBX_API int mdbx_estimate_range(const MDBX_txn *txn, MDBX_dbi dbi,
MDBX_val *begin_key, MDBX_val *begin_data, MDBX_val *begin_key, MDBX_val *begin_data,
MDBX_val *end_key, MDBX_val *end_data, MDBX_val *end_key, MDBX_val *end_data,
ptrdiff_t *distance_items); ptrdiff_t *distance_items);

View File

@ -3839,7 +3839,7 @@ public:
txn_managed start_nested(); txn_managed start_nested();
/// \brief Opens cursor for specified key-value map handle. /// \brief Opens cursor for specified key-value map handle.
inline cursor_managed open_cursor(map_handle map); inline cursor_managed open_cursor(map_handle map) const;
/// \brief Unbind or close all cursors. /// \brief Unbind or close all cursors.
inline size_t release_all_cursors(bool unbind) const; inline size_t release_all_cursors(bool unbind) const;
@ -4226,11 +4226,11 @@ public:
/// \brief Renew/bind a cursor with a new transaction and previously used /// \brief Renew/bind a cursor with a new transaction and previously used
/// key-value map handle. /// key-value map handle.
inline void renew(::mdbx::txn &txn); inline void renew(const ::mdbx::txn &txn);
/// \brief Bind/renew a cursor with a new transaction and specified key-value /// \brief Bind/renew a cursor with a new transaction and specified key-value
/// map handle. /// map handle.
inline void bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle); inline void bind(const ::mdbx::txn &txn, ::mdbx::map_handle map_handle);
/// \brief Unbind cursor from a transaction. /// \brief Unbind cursor from a transaction.
inline void unbind(); inline void unbind();
@ -5469,7 +5469,7 @@ inline txn::info txn::get_info(bool scan_reader_lock_table) const {
return r; return r;
} }
inline cursor_managed txn::open_cursor(map_handle map) { inline cursor_managed txn::open_cursor(map_handle map) const {
MDBX_cursor *ptr; MDBX_cursor *ptr;
error::success_or_throw(::mdbx_cursor_open(handle_, map.dbi, &ptr)); error::success_or_throw(::mdbx_cursor_open(handle_, map.dbi, &ptr));
return cursor_managed(ptr); return cursor_managed(ptr);
@ -6121,11 +6121,12 @@ inline ptrdiff_t cursor::estimate(move_operation operation) const {
return estimate(operation, &unused_key, nullptr); return estimate(operation, &unused_key, nullptr);
} }
inline void cursor::renew(::mdbx::txn &txn) { inline void cursor::renew(const ::mdbx::txn &txn) {
error::success_or_throw(::mdbx_cursor_renew(txn, handle_)); error::success_or_throw(::mdbx_cursor_renew(txn, handle_));
} }
inline void cursor::bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle) { inline void cursor::bind(const ::mdbx::txn &txn,
::mdbx::map_handle map_handle) {
error::success_or_throw(::mdbx_cursor_bind(txn, handle_, map_handle.dbi)); error::success_or_throw(::mdbx_cursor_bind(txn, handle_, map_handle.dbi));
} }

View File

@ -3386,7 +3386,7 @@ static int __must_check_result cursor_first(MDBX_cursor *mc, MDBX_val *key,
static int __must_check_result cursor_last(MDBX_cursor *mc, MDBX_val *key, static int __must_check_result cursor_last(MDBX_cursor *mc, MDBX_val *key,
MDBX_val *data); MDBX_val *data);
static int __must_check_result cursor_init(MDBX_cursor *mc, MDBX_txn *txn, static int __must_check_result cursor_init(MDBX_cursor *mc, const MDBX_txn *txn,
size_t dbi); size_t dbi);
static int __must_check_result cursor_xinit0(MDBX_cursor *mc); static int __must_check_result cursor_xinit0(MDBX_cursor *mc);
static int __must_check_result cursor_xinit1(MDBX_cursor *mc, MDBX_node *node, static int __must_check_result cursor_xinit1(MDBX_cursor *mc, MDBX_node *node,
@ -9582,7 +9582,7 @@ int mdbx_txn_flags(const MDBX_txn *txn) {
} }
/* Check for misused dbi handles */ /* Check for misused dbi handles */
static __inline bool dbi_changed(MDBX_txn *txn, size_t dbi) { static __inline bool dbi_changed(const MDBX_txn *txn, size_t dbi) {
if (txn->mt_dbiseqs == txn->mt_env->me_dbiseqs) if (txn->mt_dbiseqs == txn->mt_env->me_dbiseqs)
return false; return false;
if (likely( if (likely(
@ -11171,7 +11171,7 @@ static int txn_write(MDBX_txn *txn, iov_ctx_t *ctx) {
} }
/* Check txn and dbi arguments to a function */ /* Check txn and dbi arguments to a function */
static __always_inline bool check_dbi(MDBX_txn *txn, MDBX_dbi dbi, static __always_inline bool check_dbi(const MDBX_txn *txn, MDBX_dbi dbi,
unsigned validity) { unsigned validity) {
if (likely(dbi < txn->mt_numdbs)) { if (likely(dbi < txn->mt_numdbs)) {
if (likely(!dbi_changed(txn, dbi))) { if (likely(!dbi_changed(txn, dbi))) {
@ -11182,7 +11182,7 @@ static __always_inline bool check_dbi(MDBX_txn *txn, MDBX_dbi dbi,
return false; return false;
} }
} }
return dbi_import(txn, dbi); return dbi_import((MDBX_txn *)txn, dbi);
} }
/* Merge child txn into parent */ /* Merge child txn into parent */
@ -16083,7 +16083,8 @@ static __always_inline int node_read(MDBX_cursor *mc, const MDBX_node *node,
return node_read_bigdata(mc, node, data, mp); return node_read_bigdata(mc, node, data, mp);
} }
int mdbx_get(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data) { int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key,
MDBX_val *data) {
DKBUF_DEBUG; DKBUF_DEBUG;
DEBUG("===> get db %u key [%s]", dbi, DKEY_DEBUG(key)); DEBUG("===> get db %u key [%s]", dbi, DKEY_DEBUG(key));
@ -16105,7 +16106,7 @@ int mdbx_get(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data) {
return cursor_set(&cx.outer, (MDBX_val *)key, data, MDBX_SET).err; return cursor_set(&cx.outer, (MDBX_val *)key, data, MDBX_SET).err;
} }
int mdbx_get_equal_or_great(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, int mdbx_get_equal_or_great(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key,
MDBX_val *data) { MDBX_val *data) {
int rc = check_txn(txn, MDBX_TXN_BLOCKED); int rc = check_txn(txn, MDBX_TXN_BLOCKED);
if (unlikely(rc != MDBX_SUCCESS)) if (unlikely(rc != MDBX_SUCCESS))
@ -16128,8 +16129,8 @@ int mdbx_get_equal_or_great(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key,
return cursor_get(&cx.outer, key, data, MDBX_SET_LOWERBOUND); return cursor_get(&cx.outer, key, data, MDBX_SET_LOWERBOUND);
} }
int mdbx_get_ex(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, int mdbx_get_ex(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key,
size_t *values_count) { MDBX_val *data, size_t *values_count) {
DKBUF_DEBUG; DKBUF_DEBUG;
DEBUG("===> get db %u key [%s]", dbi, DKEY_DEBUG(key)); DEBUG("===> get db %u key [%s]", dbi, DKEY_DEBUG(key));
@ -18759,13 +18760,13 @@ static int cursor_xinit2(MDBX_cursor *mc, MDBX_xcursor *src_mx,
} }
static __inline int couple_init(MDBX_cursor_couple *couple, const size_t dbi, static __inline int couple_init(MDBX_cursor_couple *couple, const size_t dbi,
MDBX_txn *const txn, MDBX_db *const db, const MDBX_txn *const txn, MDBX_db *const db,
MDBX_dbx *const dbx, uint8_t *const dbstate) { MDBX_dbx *const dbx, uint8_t *const dbstate) {
couple->outer.mc_signature = MDBX_MC_LIVE; couple->outer.mc_signature = MDBX_MC_LIVE;
couple->outer.mc_next = NULL; couple->outer.mc_next = NULL;
couple->outer.mc_backup = NULL; couple->outer.mc_backup = NULL;
couple->outer.mc_dbi = (MDBX_dbi)dbi; couple->outer.mc_dbi = (MDBX_dbi)dbi;
couple->outer.mc_txn = txn; couple->outer.mc_txn = (MDBX_txn *)txn;
couple->outer.mc_db = db; couple->outer.mc_db = db;
couple->outer.mc_dbx = dbx; couple->outer.mc_dbx = dbx;
couple->outer.mc_dbistate = dbstate; couple->outer.mc_dbistate = dbstate;
@ -18803,7 +18804,7 @@ static __inline int couple_init(MDBX_cursor_couple *couple, const size_t dbi,
} }
/* Initialize a cursor for a given transaction and database. */ /* Initialize a cursor for a given transaction and database. */
static int cursor_init(MDBX_cursor *mc, MDBX_txn *txn, size_t dbi) { static int cursor_init(MDBX_cursor *mc, const MDBX_txn *txn, size_t dbi) {
STATIC_ASSERT(offsetof(MDBX_cursor_couple, outer) == 0); STATIC_ASSERT(offsetof(MDBX_cursor_couple, outer) == 0);
return couple_init(container_of(mc, MDBX_cursor_couple, outer), dbi, txn, return couple_init(container_of(mc, MDBX_cursor_couple, outer), dbi, txn,
&txn->mt_dbs[dbi], &txn->mt_dbxs[dbi], &txn->mt_dbs[dbi], &txn->mt_dbxs[dbi],
@ -18878,7 +18879,7 @@ int mdbx_cursor_unbind(MDBX_cursor *mc) {
return MDBX_SUCCESS; return MDBX_SUCCESS;
} }
int mdbx_cursor_bind(MDBX_txn *txn, MDBX_cursor *mc, MDBX_dbi dbi) { int mdbx_cursor_bind(const MDBX_txn *txn, MDBX_cursor *mc, MDBX_dbi dbi) {
if (unlikely(!mc)) if (unlikely(!mc))
return MDBX_EINVAL; return MDBX_EINVAL;
@ -18932,7 +18933,7 @@ int mdbx_cursor_bind(MDBX_txn *txn, MDBX_cursor *mc, MDBX_dbi dbi) {
return MDBX_SUCCESS; return MDBX_SUCCESS;
} }
int mdbx_cursor_open(MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **ret) { int mdbx_cursor_open(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **ret) {
if (unlikely(!ret)) if (unlikely(!ret))
return MDBX_EINVAL; return MDBX_EINVAL;
*ret = NULL; *ret = NULL;
@ -18951,7 +18952,7 @@ int mdbx_cursor_open(MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **ret) {
return MDBX_SUCCESS; return MDBX_SUCCESS;
} }
int mdbx_cursor_renew(MDBX_txn *txn, MDBX_cursor *mc) { int mdbx_cursor_renew(const MDBX_txn *txn, MDBX_cursor *mc) {
return likely(mc) ? mdbx_cursor_bind(txn, mc, mc->mc_dbi) : MDBX_EINVAL; return likely(mc) ? mdbx_cursor_bind(txn, mc, mc->mc_dbi) : MDBX_EINVAL;
} }
@ -22244,7 +22245,7 @@ __cold int mdbx_env_stat_ex(const MDBX_env *env, const MDBX_txn *txn,
return rc; return rc;
} }
__cold int mdbx_dbi_dupsort_depthmask(MDBX_txn *txn, MDBX_dbi dbi, __cold int mdbx_dbi_dupsort_depthmask(const MDBX_txn *txn, MDBX_dbi dbi,
uint32_t *mask) { uint32_t *mask) {
int rc = check_txn(txn, MDBX_TXN_BLOCKED); int rc = check_txn(txn, MDBX_TXN_BLOCKED);
if (unlikely(rc != MDBX_SUCCESS)) if (unlikely(rc != MDBX_SUCCESS))
@ -22860,7 +22861,7 @@ int mdbx_dbi_open_ex2(MDBX_txn *txn, const MDBX_val *name,
return dbi_open(txn, name, flags, dbi, keycmp, datacmp); return dbi_open(txn, name, flags, dbi, keycmp, datacmp);
} }
__cold int mdbx_dbi_stat(MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *dest, __cold int mdbx_dbi_stat(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *dest,
size_t bytes) { size_t bytes) {
int rc = check_txn(txn, MDBX_TXN_BLOCKED); int rc = check_txn(txn, MDBX_TXN_BLOCKED);
if (unlikely(rc != MDBX_SUCCESS)) if (unlikely(rc != MDBX_SUCCESS))
@ -22880,7 +22881,7 @@ __cold int mdbx_dbi_stat(MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *dest,
return MDBX_BAD_TXN; return MDBX_BAD_TXN;
if (unlikely(txn->mt_dbistate[dbi] & DBI_STALE)) { if (unlikely(txn->mt_dbistate[dbi] & DBI_STALE)) {
rc = fetch_sdb(txn, dbi); rc = fetch_sdb((MDBX_txn *)txn, dbi);
if (unlikely(rc != MDBX_SUCCESS)) if (unlikely(rc != MDBX_SUCCESS))
return rc; return rc;
} }
@ -22941,7 +22942,7 @@ int mdbx_dbi_close(MDBX_env *env, MDBX_dbi dbi) {
return rc; return rc;
} }
int mdbx_dbi_flags_ex(MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags, int mdbx_dbi_flags_ex(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags,
unsigned *state) { unsigned *state) {
int rc = check_txn(txn, MDBX_TXN_BLOCKED - MDBX_TXN_ERROR); int rc = check_txn(txn, MDBX_TXN_BLOCKED - MDBX_TXN_ERROR);
if (unlikely(rc != MDBX_SUCCESS)) if (unlikely(rc != MDBX_SUCCESS))
@ -24113,7 +24114,7 @@ int mdbx_estimate_move(const MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data,
return mdbx_estimate_distance(cursor, &next.outer, distance_items); return mdbx_estimate_distance(cursor, &next.outer, distance_items);
} }
int mdbx_estimate_range(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *begin_key, int mdbx_estimate_range(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *begin_key,
MDBX_val *begin_data, MDBX_val *end_key, MDBX_val *begin_data, MDBX_val *end_key,
MDBX_val *end_data, ptrdiff_t *size_items) { MDBX_val *end_data, ptrdiff_t *size_items) {
int rc = check_txn(txn, MDBX_TXN_BLOCKED); int rc = check_txn(txn, MDBX_TXN_BLOCKED);
@ -25455,7 +25456,8 @@ LIBMDBX_API __cold int mdbx_env_info(const MDBX_env *env, MDBX_envinfo *info,
return __inline_mdbx_env_info(env, info, bytes); return __inline_mdbx_env_info(env, info, bytes);
} }
LIBMDBX_API int mdbx_dbi_flags(MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags) { LIBMDBX_API int mdbx_dbi_flags(const MDBX_txn *txn, MDBX_dbi dbi,
unsigned *flags) {
return __inline_mdbx_dbi_flags(txn, dbi, flags); return __inline_mdbx_dbi_flags(txn, dbi, flags);
} }