8000 Rename CACHE_LINE_SIZE to PG_CACHE_LINE_SIZE. · pykello/postgres@f78319f · GitHub
[go: up one dir, main page]

Skip to content

Commit f78319f

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 721a8bb commit f78319f

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
@@ -408,7 +408,7 @@ typedef struct
408408
typedef union WALInsertLockPadded
409409
{
410410
WALInsertLock l;
411-
char pad[CACHE_LINE_SIZE];
411+
char pad[PG_CACHE_LINE_SIZE];
412412
} WALInsertLockPadded;
413413

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

440440
/*
441441
* 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
@@ -216,7 +216,7 @@
216216
* bytes of wasted memory. The default is 128, which should be large enough
217217
* for all supported platforms.
218218
*/
219-
#define CACHE_LINE_SIZE 128
219+
#define PG_CACHE_LINE_SIZE 128
220220

221221
/*
222222
*------------------------------------------------------------------------

0 commit comments

Comments
 (0)
0