mdbx: minor refine WITH_CURSOR_TRACKING macro.

Change-Id: I61a4782ae76aed624fe37f7dde2b0ef7eb5dfb64
This commit is contained in:
Leonid Yuriev 2020-10-07 21:59:30 +03:00
parent 76b3fd4311
commit 0f3b82f661

View File

@ -3567,17 +3567,18 @@ static __maybe_unused void mdbx_page_list(MDBX_page *mp) {
do { \ do { \
mdbx_cassert(&(mn), \ mdbx_cassert(&(mn), \
mn.mc_txn->mt_cursors != NULL /* must be not rdonly txt */); \ mn.mc_txn->mt_cursors != NULL /* must be not rdonly txt */); \
MDBX_cursor mc_dummy, **tp = &(mn).mc_txn->mt_cursors[mn.mc_dbi]; \ MDBX_cursor mc_dummy; \
MDBX_cursor **tracking_head = &(mn).mc_txn->mt_cursors[mn.mc_dbi]; \
MDBX_cursor *tracked = &(mn); \ MDBX_cursor *tracked = &(mn); \
if ((mn).mc_flags & C_SUB) { \ if ((mn).mc_flags & C_SUB) { \
mc_dummy.mc_flags = C_INITIALIZED; \ mc_dummy.mc_flags = C_INITIALIZED; \
mc_dummy.mc_xcursor = (MDBX_xcursor *)&(mn); \ mc_dummy.mc_xcursor = (MDBX_xcursor *)&(mn); \
tracked = &mc_dummy; \ tracked = &mc_dummy; \
} \ } \
tracked->mc_next = *tp; \ tracked->mc_next = *tracking_head; \
*tp = tracked; \ *tracking_head = tracked; \
{ act; } \ { act; } \
*tp = tracked->mc_next; \ *tracking_head = tracked->mc_next; \
} while (0) } while (0)
int mdbx_cmp(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *a, int mdbx_cmp(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *a,