Rename CACHE_LINE_SIZE to PG_CACHE_LINE_SIZE.
authorAndres Freund
Wed, 1 Oct 2014 09:54:05 +0000 (11:54 +0200)
committerAndres Freund
Wed, 1 Oct 2014 09:56:58 +0000 (11:56 +0200)
As noted in http://bugs.debian.org/763098 there is a conflict between
postgres' definition of CACHE_LINE_SIZE and the definition by various
*bsd platforms. It's debatable who has the right to define such a
name, but postgres' use was only introduced in 375d8526f290 (9.4), so
it seems like a good idea to rename it.

Discussion: 20140930195756[email protected]

Per complaint of Christoph Berg in the above email, although he's not
the original bug reporter.

Backpatch to 9.4 where the define was introduced.

src/backend/access/transam/xlog.c
src/include/pg_config_manual.h

index 7eea5fabaf5d4f64a40b59bb7a5a665297817319..9b938bda740bda499bd36b8e1b95258c20d3caec 100644 (file)
@@ -408,7 +408,7 @@ typedef struct
 typedef union WALInsertLockPadded
 {
    WALInsertLock l;
-   char        pad[CACHE_LINE_SIZE];
+   char        pad[PG_CACHE_LINE_SIZE];
 } WALInsertLockPadded;
 
 /*
@@ -435,7 +435,7 @@ typedef struct XLogCtlInsert
     * read on every WAL insertion, but updated rarely, and we don't want
     * those reads to steal the cache line containing Curr/PrevBytePos.
     */
-   char        pad[CACHE_LINE_SIZE];
+   char        pad[PG_CACHE_LINE_SIZE];
 
    /*
     * fullPageWrites is the master copy used by all backends to determine
index d1f99fbafef3260b60faf386000cfd786e57c55c..ba17c4d1f255b964335ebcae73a6dff3ff29d098 100644 (file)
  * bytes of wasted memory. The default is 128, which should be large enough
  * for all supported platforms.
  */
-#define CACHE_LINE_SIZE        128
+#define PG_CACHE_LINE_SIZE     128
 
 /*
  *------------------------------------------------------------------------