Skip to content

Commit 6dbe1be

Browse files
committed
Restructure padding to handle structure already 128 bytes(alpha).
1 parent 60265ee commit 6dbe1be

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/include/storage/buf_internals.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: buf_internals.h,v 1.10 1997/01/23 18:15:29 momjian Exp $
9+
* $Id: buf_internals.h,v 1.11 1997/01/25 03:09:33 momjian Exp $
1010
*
1111
* NOTE
1212
* If BUFFERPAGE0 is defined, then 0 will be used as a
@@ -115,12 +115,13 @@ struct sbufdesc_unpadded {
115115
BufFlags flags;
116116
int16 bufsmgr;
117117
unsigned refcount;
118-
char sb_dbname[NAMEDATALEN+1];
119-
char sb_relname[NAMEDATALEN+1];
120118
#ifdef HAS_TEST_AND_SET
121119
slock_t io_in_progress_lock;
122120
#endif /* HAS_TEST_AND_SET */
123-
/* NOTE NO sb_pad HERE */
121+
char sb_dbname[NAMEDATALEN+1];
122+
123+
/* NOTE NO PADDING OF THE MEMBER HERE */
124+
char sb_relname[NAMEDATALEN+1];
124125
};
125126

126127
/* THE REAL STRUCTURE - the structure above must match it, minus sb_pad */
@@ -137,13 +138,13 @@ struct sbufdesc {
137138
int16 bufsmgr; /* storage manager id for buffer */
138139
unsigned refcount; /* # of times buffer is pinned */
139140

140-
char sb_dbname[NAMEDATALEN+1]; /* name of db in which buf belongs */
141-
char sb_relname[NAMEDATALEN+1]; /* name of reln */
142141
#ifdef HAS_TEST_AND_SET
143142
/* can afford a dedicated lock if test-and-set locks are available */
144143
slock_t io_in_progress_lock;
145144
#endif /* HAS_TEST_AND_SET */
146145

146+
char sb_dbname[NAMEDATALEN+1]; /* name of db in which buf belongs */
147+
147148
/*
148149
* I padded this structure to a power of 2 (PADDED_SBUFDESC_SIZE) because
149150
* BufferDescriptorGetBuffer is called a billion times and it does an
@@ -155,7 +156,11 @@ struct sbufdesc {
155156
* going to make some of these types bigger soon anyway... -pma 1/2/93
156157
*/
157158

158-
char sb_pad[PADDED_SBUFDESC_SIZE-sizeof(struct sbufdesc_unpadded)];
159+
/* please, don't take the sizeof() this member and use it for
160+
something important */
161+
162+
char sb_relname[NAMEDATALEN+1+ /* name of reln */
163+
PADDED_SBUFDESC_SIZE-sizeof(struct sbufdesc_unpadded)];
159164
};
160165

161166
/*

0 commit comments

Comments
 (0)