Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
fa937b5e
Commit
fa937b5e
authored
Jan 23, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove SB_PAD. Compute padding at compile time.
parent
f0ff9ac0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
21 deletions
+36
-21
src/backend/storage/buffer/buf_init.c
src/backend/storage/buffer/buf_init.c
+9
-1
src/include/config.h
src/include/config.h
+0
-13
src/include/storage/buf_internals.h
src/include/storage/buf_internals.h
+27
-7
No files found.
src/backend/storage/buffer/buf_init.c
View file @
fa937b5e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.
4 1997/01/16 08:04:30 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.
5 1997/01/23 18:14:40 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -135,6 +135,14 @@ InitBufferPool(IPCKey key)
bool
foundBufs
,
foundDescs
;
int
i
;
/* check padding of BufferDesc and BufferHdr */
if
(
sizeof
(
struct
sbufdesc
)
!=
PADDED_SBUFDESC_SIZE
)
elog
(
WARN
,
"Internal error: sbufdesc does not have the proper size, "
"contact the Postgres developers"
);
if
(
sizeof
(
struct
sbufdesc_unpadded
)
<=
PADDED_SBUFDESC_SIZE
/
2
)
elog
(
WARN
,
"Internal error: sbufdesc is greatly over-sized, "
"contact the Postgres developers"
);
Data_Descriptors
=
NBuffers
;
Free_List_Descriptor
=
Data_Descriptors
;
Lookup_List_Descriptor
=
Data_Descriptors
+
1
;
...
...
src/include/config.h
View file @
fa937b5e
...
...
@@ -28,7 +28,6 @@
# define NEED_SYS_SELECT_H
# define HAVE_TZSET
# define HAVE_ANSI_CPP
# define SB_PAD 44
# define HAS_TEST_AND_SET
typedef
unsigned
int
slock_t
;
#endif
...
...
@@ -40,7 +39,6 @@
# define NEED_ISINF
# define HAS_LONG_LONG
# define NEED_UNION_SEMUN
# define SB_PAD 40
# define HAS_TEST_AND_SET
# include <sys/mman.h>
/* for msemaphore */
typedef
msemaphore
slock_t
;
...
...
@@ -51,7 +49,6 @@
# define USE_POSIX_TIME
# define NEED_CBRT
# define NEED_I386_TAS_ASM
# define SB_PAD 56
# define HAS_TEST_AND_SET
# if defined(__mips__)
# undef HAS_TEST_AND_SET
...
...
@@ -62,11 +59,9 @@
#if defined(bsdi)
# if defined(i386)
# define NEED_I386_TAS_ASM
# define SB_PAD 56
# endif
# if defined(sparc)
# define NEED_SPARC_TAS_ASM
# define SB_PAD 56
# endif
# if defined(PRE_BSDI_2_1)
# define NEED_UNION_SEMUN
...
...
@@ -92,7 +87,6 @@
# define NEED_CBRT
# define NEED_RINT
# define NEED_UNION_SEMUN
# define SB_PAD 44
# define HAS_TEST_AND_SET
typedef
struct
{
int
sem
[
4
];
}
slock_t
;
#endif
...
...
@@ -107,7 +101,6 @@
# define HAVE_TZSET
# define NEED_UNION_SEMUN
# define SYSV_DIRENT
# define SB_PAD 56
# define HAS_TEST_AND_SET
typedef
unsigned
char
slock_t
;
#endif
...
...
@@ -120,7 +113,6 @@
# define NO_VFORK
# define HAVE_TZSET
# define SYSV_DIRENT
# define SB_PAD 44
# define HAS_TEST_AND_SET
# include <abi_mutex.h>
typedef
abilock_t
slock_t
;
...
...
@@ -138,7 +130,6 @@
# define HAVE_TZSET
# define NEED_CBRT
# define NEED_I386_TAS_ASM
# define SB_PAD 56
# define HAS_TEST_AND_SET
typedef
unsigned
char
slock_t
;
#endif
...
...
@@ -163,7 +154,6 @@
# define USE_LIMITS_H
# define JMP_BUF
# define SB_PAD 56
# define NO_WAITPID
typedef
struct
mutex
slock_t
;
#endif
...
...
@@ -183,14 +173,12 @@
# define HAVE_TZSET
# define NEED_UNION_SEMUN
# define SYSV_DIRENT
# define SB_PAD 56
# define HAS_TEST_AND_SET
typedef
unsigned
char
slock_t
;
#endif
#if defined(sunos4)
# define USE_POSIX_TIME
# define SB_PAD 56
# undef HAVE_MEMMOVE
#endif
...
...
@@ -225,7 +213,6 @@ typedef unsigned char slock_t;
# define USE_POSIX_TIME
# define NEED_UNION_SEMUN
# define NEED_STRDUP
# define SB_PAD 60
#endif
...
...
src/include/storage/buf_internals.h
View file @
fa937b5e
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: buf_internals.h,v 1.
9 1997/01/20 04:06:13 vadim
Exp $
* $Id: buf_internals.h,v 1.
10 1997/01/23 18:15:29 momjian
Exp $
*
* NOTE
* If BUFFERPAGE0 is defined, then 0 will be used as a
...
...
@@ -100,6 +100,30 @@ struct buftag{
* to put the buffer, for all storage managers.
*/
#define PADDED_SBUFDESC_SIZE 128
/* DO NOT CHANGE THIS NEXT STRUCTURE:
It is used only to get padding information for the real sbufdesc structure
It should match the sbufdesc structure exactly except for a missing sb_pad
*/
struct
sbufdesc_unpadded
{
Buffer
freeNext
;
Buffer
freePrev
;
SHMEM_OFFSET
data
;
BufferTag
tag
;
int
buf_id
;
BufFlags
flags
;
int16
bufsmgr
;
unsigned
refcount
;
char
sb_dbname
[
NAMEDATALEN
+
1
];
char
sb_relname
[
NAMEDATALEN
+
1
];
#ifdef HAS_TEST_AND_SET
slock_t
io_in_progress_lock
;
#endif
/* HAS_TEST_AND_SET */
/* NOTE NO sb_pad HERE */
};
/* THE REAL STRUCTURE - the structure above must match it, minus sb_pad */
struct
sbufdesc
{
Buffer
freeNext
;
/* link for freelist chain */
Buffer
freePrev
;
...
...
@@ -121,7 +145,7 @@ struct sbufdesc {
#endif
/* HAS_TEST_AND_SET */
/*
* I padded this structure to a power of 2 (
128 bytes on a MIPS
) because
* I padded this structure to a power of 2 (
PADDED_SBUFDESC_SIZE
) because
* BufferDescriptorGetBuffer is called a billion times and it does an
* C pointer subtraction (i.e., "x - y" -> array index of x relative
* to y, which is calculated using division by struct size). Integer
...
...
@@ -131,11 +155,7 @@ struct sbufdesc {
* going to make some of these types bigger soon anyway... -pma 1/2/93
*/
/*
* NOTE: This is now defined in the ..../include/config.h file!
*/
char
sb_pad
[
SB_PAD
];
char
sb_pad
[
PADDED_SBUFDESC_SIZE
-
sizeof
(
struct
sbufdesc_unpadded
)];
};
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment