Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ae72283

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 this is really what is going on, and merge the NOFIXADE and NOPRINTADE code paths.
1 parent 3331180 commit ae72283

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/24 06:29:07 neilc Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -71,18 +71,23 @@ main(int argc, char *argv[])
7171

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

8178
#ifdef WIN32
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+
#ifdef NOFIXADE
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)