• Tom Lane's avatar
    Replace memcpy() calls in xlog.c critical sections with struct assignments. · 2a2352e0
    Tom Lane authored
    This gets rid of a dangerous-looking use of the not-volatile XLogCtl
    pointer in a couple of spinlock-protected sections, where the normal
    coding rule is that you should only access shared memory through a
    pointer-to-volatile.  I think the risk is only hypothetical not actual,
    since for there to be a bug the compiler would have to move the spinlock
    acquire or release across the memcpy() call, which one sincerely hopes
    it will not.  Still, it looks cleaner this way.
    
    Per comment from Daniel Farina and subsequent discussion.
    2a2352e0
xlog.c 316 KB