Hello, Antonin!
Some comments for 0003:
> /* allocate in transaction context */
It may be any context now, because it is a function now.
> result = CopySnapshot(snapshot);
> /* Restore the original values so the source is intact. */
> snapshot->xip = oldxip;
> snapshot->xcnt = oldxcnt;
I think it is worth to call pfree(newxip) here.
> "This difference does has no impact"
should be "This difference has no impact"?
Best regards,
Mikhail.