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

Commitae72283

Browse files
author
Neil Conway
committed
Cleanup some ancient Ultrix / Alpha code in main() that is intended to
modify how unaligned memory accesses are dealt with. Document that thisis really what is going on, and merge the NOFIXADE and NOPRINTADE codepaths.
1 parent3331180 commitae72283

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎src/backend/main/main.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*
1515
* IDENTIFICATION
16-
* $PostgreSQL: pgsql/src/backend/main/main.c,v 1.89 2004/08/29 05:06:43 momjian Exp $
16+
* $PostgreSQL: pgsql/src/backend/main/main.c,v 1.90 2004/09/2406:29:07 neilc Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -71,18 +71,23 @@ main(int argc, char *argv[])
7171

7272
#if defined(__alpha)/* no __alpha__ ? */
7373
#ifdefNOFIXADE
74-
intbuffer[]= {SSIN_UACPROC,UAC_SIGBUS};
75-
#endif/* NOFIXADE */
76-
#ifdefNOPRINTADE
77-
intbuffer[]= {SSIN_UACPROC,UAC_NOPRINT};
78-
#endif/* NOPRINTADE */
74+
intbuffer[]= {SSIN_UACPROC,UAC_SIGBUS |UAC_NOPRINT};
75+
#endif
7976
#endif/* __alpha */
8077

8178
#ifdefWIN32
8279
char*env_locale;
8380
#endif
8481

85-
#if defined(NOFIXADE)|| defined(NOPRINTADE)
82+
/*
83+
* On some platforms, unaligned memory accesses result in a kernel
84+
* trap; the default kernel behavior is to emulate the memory
85+
* access, but this results in a significant performance
86+
* penalty. We ought to fix PG not to make such unaligned memory
87+
* accesses, so this code disables the kernel emulation: unaligned
88+
* accesses will result in SIGBUS instead.
89+
*/
90+
#ifdefNOFIXADE
8691

8792
#if defined(ultrix4)
8893
syscall(SYS_sysmips,MIPS_FIXADE,0,NULL,NULL,NULL);
@@ -94,7 +99,7 @@ main(int argc, char *argv[])
9499
write_stderr("%s: setsysinfo failed: %s\n",
95100
argv[0],strerror(errno));
96101
#endif
97-
#endif/* NOFIXADE|| NOPRINTADE*/
102+
#endif/* NOFIXADE */
98103

99104
#if defined(WIN32)
100105
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp