Skip site navigation (1) Skip section navigation (2)

pgsql: Replace memcpy() calls in xlog.c critical sections with structa

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Replace memcpy() calls in xlog.c critical sections with structa
Date: 2012-09-03 19:39:45
Message-ID: E1T8cUr-00078J-Ej@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Replace memcpy() calls in xlog.c critical sections with struct assignments.

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2a2352e07df9ccc70689061b6453e226a56e7c79

Modified Files
--------------
src/backend/access/transam/xlog.c |    6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

pgsql-committers by date

Next:From: Andrew DunstanDate: 2012-09-03 22:15:37
Subject: pgsql: Use correct path separator for Windows builtin commands.
Previous:From: Andrew DunstanDate: 2012-09-03 19:33:48
Subject: pgsql: Fix bugs in exec.c that prevented pg_upgrade working inWindows.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group