From 79465dbc7fafbfda07f3ad1d3f62baa7ac187850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sun, 27 Jul 2025 23:01:48 +0300 Subject: [PATCH] mdbx: refactor internal walking functions. --- src/walk.c | 13 +------------ src/walk.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/walk.c b/src/walk.c index 4a8c6e8c..4399c211 100644 --- a/src/walk.c +++ b/src/walk.c @@ -3,17 +3,6 @@ #include "internals.h" -typedef struct walk_ctx { - void *userctx; - walk_options_t options; - int deep; - walk_func *visitor; - MDBX_txn *txn; - MDBX_cursor *cursor; -} walk_ctx_t; - -__cold static int walk_tbl(walk_ctx_t *ctx, walk_tbl_t *tbl); - static page_type_t walk_page_type(const page_t *mp) { if (mp) switch (mp->flags & ~P_SPILLED) { @@ -251,7 +240,7 @@ __cold static int walk_pgno(walk_ctx_t *ctx, walk_tbl_t *tbl, const pgno_t pgno, return MDBX_SUCCESS; } -__cold static int walk_tbl(walk_ctx_t *ctx, walk_tbl_t *tbl) { +__cold int walk_tbl(walk_ctx_t *ctx, walk_tbl_t *tbl) { tree_t *const db = tbl->internal; if (unlikely(db->root == P_INVALID)) return MDBX_SUCCESS; /* empty db */ diff --git a/src/walk.h b/src/walk.h index c87b8479..0feee06d 100644 --- a/src/walk.h +++ b/src/walk.h @@ -18,3 +18,14 @@ typedef int walk_func(const size_t pgno, const unsigned number, void *const ctx, typedef enum walk_options { dont_check_keys_ordering = 1 } walk_options_t; MDBX_INTERNAL int walk_pages(MDBX_txn *txn, walk_func *visitor, void *user, walk_options_t options); + +typedef struct walk_ctx { + void *userctx; + walk_options_t options; + int deep; + walk_func *visitor; + MDBX_txn *txn; + MDBX_cursor *cursor; +} walk_ctx_t; + +MDBX_INTERNAL int walk_tbl(walk_ctx_t *ctx, walk_tbl_t *tbl);