From 436998ca83768d690e6bc1fa0c322cd8b828bf38 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: Thu, 6 Mar 2025 10:27:34 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=BA=D0=BE=D1=81=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8=D0=B9=20=D1=80=D0=B5=D1=84?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=20`cursor=5Fsh?= =?UTF-8?q?adow()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cursor.c | 18 +++++++++--------- src/cursor.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cursor.c b/src/cursor.c index 766943f7..b0857e73 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -184,12 +184,12 @@ __hot int cursor_touch(MDBX_cursor *const mc, const MDBX_val *key, const MDBX_va /*----------------------------------------------------------------------------*/ -int cursor_shadow(MDBX_cursor *cursor, MDBX_txn *nested_txn, const size_t dbi) { - tASSERT(nested_txn, cursor->signature == cur_signature_live); - tASSERT(nested_txn, cursor->txn != nested_txn); +int cursor_shadow(MDBX_cursor *cursor, MDBX_txn *nested, const size_t dbi) { + tASSERT(nested, cursor->signature == cur_signature_live); + tASSERT(nested, cursor->txn != nested); cASSERT(cursor, cursor->txn->flags & txn_may_have_cursors); cASSERT(cursor, dbi == cursor_dbi(cursor)); - tASSERT(nested_txn, dbi > FREE_DBI && dbi < nested_txn->n_dbi); + tASSERT(nested, dbi > FREE_DBI && dbi < nested->n_dbi); const size_t size = cursor->subcur ? sizeof(MDBX_cursor) + sizeof(subcur_t) : sizeof(MDBX_cursor); MDBX_cursor *const shadow = osal_malloc(size); @@ -202,14 +202,14 @@ int cursor_shadow(MDBX_cursor *cursor, MDBX_txn *nested_txn, const size_t dbi) { #endif /* MDBX_DEBUG */ *shadow = *cursor; cursor->backup = shadow; - cursor->txn = nested_txn; - cursor->tree = &nested_txn->dbs[dbi]; - cursor->dbi_state = &nested_txn->dbi_state[dbi]; + cursor->txn = nested; + cursor->tree = &nested->dbs[dbi]; + cursor->dbi_state = &nested->dbi_state[dbi]; subcur_t *subcur = cursor->subcur; if (subcur) { *(subcur_t *)(shadow + 1) = *subcur; - subcur->cursor.txn = nested_txn; - subcur->cursor.dbi_state = cursor->dbi_state; + subcur->cursor.txn = nested; + subcur->cursor.dbi_state = &nested->dbi_state[dbi]; } return MDBX_SUCCESS; } diff --git a/src/cursor.h b/src/cursor.h index d4fc767b..8ca4ea72 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -293,7 +293,7 @@ MDBX_NOTHROW_PURE_FUNCTION static inline bool check_leaf_type(const MDBX_cursor } MDBX_INTERNAL void cursor_eot(MDBX_cursor *cursor); -MDBX_INTERNAL int cursor_shadow(MDBX_cursor *cursor, MDBX_txn *nested_txn, const size_t dbi); +MDBX_INTERNAL int cursor_shadow(MDBX_cursor *cursor, MDBX_txn *nested, const size_t dbi); MDBX_INTERNAL MDBX_cursor *cursor_cpstk(const MDBX_cursor *csrc, MDBX_cursor *cdst);