Hi, hackers

I don't quite understand FullTransactionIdAdvance(), correct me if I’m wrong.


/*
 * Advance a FullTransactionId variable, stepping over xids that would appear
 * to be special only when viewed as 32bit XIDs.
 */
static inline void
FullTransactionIdAdvance(FullTransactionId *dest)
{
        dest->value++;

        /* see FullTransactionIdAdvance() */
        if (FullTransactionIdPrecedes(*dest, FirstNormalFullTransactionId))
 return;

        while (XidFromFullTransactionId(*dest) < FirstNormalTransactionId)
 dest->value++;
}

#define XidFromFullTransactionId(x) ((x).value)
#define FullTransactionIdPrecedes(a, b) ((a).value < (b).value)

Can the codes reach line: while (XidFromFullTransactionId(*dest) < 
FirstNormalTransactionId)?
As we will return if (FullTransactionIdPrecedes(*dest, 
FirstNormalFullTransactionId)), and the two judgements seem equal.
Another confusion is the comments: /* see FullTransactionIdAdvance() */, is its 
own  itself.
Could anyone explain this? Thanks in advance.

Regards,
Zhang Mingli

Reply via email to