6
6
*
7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
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 $
10
10
*
11
11
* NOTE
12
12
* If BUFFERPAGE0 is defined, then 0 will be used as a
@@ -115,12 +115,13 @@ struct sbufdesc_unpadded {
115
115
BufFlags flags ;
116
116
int16 bufsmgr ;
117
117
unsigned refcount ;
118
- char sb_dbname [NAMEDATALEN + 1 ];
119
- char sb_relname [NAMEDATALEN + 1 ];
120
118
#ifdef HAS_TEST_AND_SET
121
119
slock_t io_in_progress_lock ;
122
120
#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 ];
124
125
};
125
126
126
127
/* THE REAL STRUCTURE - the structure above must match it, minus sb_pad */
@@ -137,13 +138,13 @@ struct sbufdesc {
137
138
int16 bufsmgr ; /* storage manager id for buffer */
138
139
unsigned refcount ; /* # of times buffer is pinned */
139
140
140
- char sb_dbname [NAMEDATALEN + 1 ]; /* name of db in which buf belongs */
141
- char sb_relname [NAMEDATALEN + 1 ]; /* name of reln */
142
141
#ifdef HAS_TEST_AND_SET
143
142
/* can afford a dedicated lock if test-and-set locks are available */
144
143
slock_t io_in_progress_lock ;
145
144
#endif /* HAS_TEST_AND_SET */
146
145
146
+ char sb_dbname [NAMEDATALEN + 1 ]; /* name of db in which buf belongs */
147
+
147
148
/*
148
149
* I padded this structure to a power of 2 (PADDED_SBUFDESC_SIZE) because
149
150
* BufferDescriptorGetBuffer is called a billion times and it does an
@@ -155,7 +156,11 @@ struct sbufdesc {
155
156
* going to make some of these types bigger soon anyway... -pma 1/2/93
156
157
*/
157
158
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 )];
159
164
};
160
165
161
166
/*
0 commit comments