Skip to content

Commit ef88638

Browse files
committed
Rename CACHE_LINE_SIZE to PG_CACHE_LINE_SIZE.
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 375d852 (9.4), so it seems like a good idea to rename it. Discussion: 20140930195756.GC27407@msg.df7cb.de 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.
1 parent 8492d86 commit ef88638

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ typedef struct
409409
typedef union WALInsertLockPadded
410410
{
411411
WALInsertLock l;
412-
char pad[CACHE_LINE_SIZE];
412+
char pad[PG_CACHE_LINE_SIZE];
413413
} WALInsertLockPadded;
414414

415415
/*
@@ -436,7 +436,7 @@ typedef struct XLogCtlInsert
436436
* read on every WAL insertion, but updated rarely, and we don't want
437437
* those reads to steal the cache line containing Curr/PrevBytePos.
438438
*/
439-
char pad[CACHE_LINE_SIZE];
439+
char pad[PG_CACHE_LINE_SIZE];
440440

441441
/*
442442
* fullPageWrites is the master copy used by all backends to determine

src/include/pg_config_manual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
* bytes of wasted memory. The default is 128, which should be large enough
239239
* for all supported platforms.
240240
*/
241-
#define CACHE_LINE_SIZE 128
241+
#define PG_CACHE_LINE_SIZE 128
242242

243243
/*
244244
*------------------------------------------------------------------------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy