Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6dbe1be

Browse files
committed
Restructure padding to handle structure already 128 bytes(alpha).
1 parent60265ee commit6dbe1be

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
BufFlagsflags;
116116
int16bufsmgr;
117117
unsignedrefcount;
118-
charsb_dbname[NAMEDATALEN+1];
119-
charsb_relname[NAMEDATALEN+1];
120118
#ifdefHAS_TEST_AND_SET
121119
slock_tio_in_progress_lock;
122120
#endif/* HAS_TEST_AND_SET */
123-
/* NOTE NO sb_pad HERE */
121+
charsb_dbname[NAMEDATALEN+1];
122+
123+
/* NOTE NO PADDING OF THE MEMBER HERE */
124+
charsb_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
int16bufsmgr;/* storage manager id for buffer */
138139
unsignedrefcount;/* # of times buffer is pinned */
139140

140-
charsb_dbname[NAMEDATALEN+1];/* name of db in which buf belongs */
141-
charsb_relname[NAMEDATALEN+1];/* name of reln */
142141
#ifdefHAS_TEST_AND_SET
143142
/* can afford a dedicated lock if test-and-set locks are available */
144143
slock_tio_in_progress_lock;
145144
#endif/* HAS_TEST_AND_SET */
146145

146+
charsb_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-
charsb_pad[PADDED_SBUFDESC_SIZE-sizeof(structsbufdesc_unpadded)];
159+
/* please, don't take the sizeof() this member and use it for
160+
something important */
161+
162+
charsb_relname[NAMEDATALEN+1+/* name of reln */
163+
PADDED_SBUFDESC_SIZE-sizeof(structsbufdesc_unpadded)];
159164
};
160165

161166
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp