aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-12-08 08:07:17 +0100
committerJoakim Verona2012-12-08 08:07:17 +0100
commit9cf1feea700673a74717ce0e6a5ceec6c6979b61 (patch)
treebe0d5de3c6d39e798438dfa20cdbb76a6a2ef7d2
parentb2be0b04729568ad263b9d54b055c95ea2a26ef1 (diff)
parent7be78020e3baaa73d047af75675ea6c92c1c1fda (diff)
downloademacs-9cf1feea700673a74717ce0e6a5ceec6c6979b61.tar.gz
emacs-9cf1feea700673a74717ce0e6a5ceec6c6979b61.zip
auto upstream
-rw-r--r--ChangeLog3
-rw-r--r--admin/CPP-DEFINES1
-rw-r--r--admin/ChangeLog5
-rw-r--r--configure.ac14
-rw-r--r--src/ChangeLog5
-rw-r--r--src/vm-limit.c75
6 files changed, 28 insertions, 75 deletions
diff --git a/ChangeLog b/ChangeLog
index cb63adc41d4..c0ab1e03b70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
12012-12-08 Paul Eggert <eggert@cs.ucla.edu> 12012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Simplify get_lim_data.
4 * configure.ac (ULIMIT_BREAK_VALUE): Remove.
5
3 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026). 6 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
4 * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF): 7 * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
5 Use SIGCHLD rather than SIGCLD. 8 Use SIGCHLD rather than SIGCLD.
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index b71102960e6..13c3da1745a 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -429,7 +429,6 @@ TERM
429TIME_WITH_SYS_TIME 429TIME_WITH_SYS_TIME
430TIOCSIGSEND 430TIOCSIGSEND
431TM_IN_SYS_TIME 431TM_IN_SYS_TIME
432ULIMIT_BREAK_VALUE
433UNIX98_PTYS 432UNIX98_PTYS
434USE_TOOLKIT_SCROLL_BARS 433USE_TOOLKIT_SCROLL_BARS
435USG_SUBTTY_WORKS 434USG_SUBTTY_WORKS
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 840c38aeb94..81d85f8f24c 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2
3 Simplify get_lim_data.
4 * CPP-DEFINES (ULIMIT_BREAK_VALUE): Remove.
5
12012-12-03 Paul Eggert <eggert@cs.ucla.edu> 62012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026). 8 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
diff --git a/configure.ac b/configure.ac
index c038b0b9bcf..9040136253f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3749,7 +3749,6 @@ case $opsys in
3749esac 3749esac
3750 3750
3751 3751
3752AH_TEMPLATE(ULIMIT_BREAK_VALUE, [Undocumented.])
3753AH_TEMPLATE(TAB3, [Undocumented.]) 3752AH_TEMPLATE(TAB3, [Undocumented.])
3754 3753
3755case $opsys in 3754case $opsys in
@@ -3761,14 +3760,6 @@ case $opsys in
3761 ;; 3760 ;;
3762 3761
3763 gnu-linux | gnu-kfreebsd ) 3762 gnu-linux | gnu-kfreebsd )
3764 dnl libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared
3765 dnl library, we cannot get the maximum address for brk.
3766 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
3767#ifndef __i386__
3768# error "not i386"
3769#endif
3770 ]], [[]])], AC_DEFINE(ULIMIT_BREAK_VALUE, [(32*1024*1024)]), [])
3771
3772 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ 3763 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
3773#ifndef __ia64__ 3764#ifndef __ia64__
3774# error "not ia64" 3765# error "not ia64"
@@ -3782,11 +3773,6 @@ case $opsys in
3782 AC_DEFINE(RUN_TIME_REMAP, 1, [Define if emacs.c needs to call 3773 AC_DEFINE(RUN_TIME_REMAP, 1, [Define if emacs.c needs to call
3783 run_time_remap; for HPUX.]) 3774 run_time_remap; for HPUX.])
3784 ;; 3775 ;;
3785
3786 irix6-5)
3787 dnl Ulimit(UL_GMEMLIM) is busted...
3788 AC_DEFINE(ULIMIT_BREAK_VALUE, [0x14000000])
3789 ;;
3790esac 3776esac
3791 3777
3792 3778
diff --git a/src/ChangeLog b/src/ChangeLog
index 2b283a609e3..218dd425a2d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12012-12-08 Paul Eggert <eggert@cs.ucla.edu> 12012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Simplify get_lim_data.
4 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
5 Remove USG and vlimit methods; no longer used these days.
6 Add #error catchall just in case.
7
3 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026). 8 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
4 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, 9 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
5 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these. 10 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 2a71e88695a..befc01d400f 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -44,46 +44,26 @@ static POINTER data_space_start;
44static size_t lim_data; 44static size_t lim_data;
45 45
46 46
47#if defined (HAVE_GETRLIMIT) && defined (RLIMIT_AS) 47#ifdef HAVE_GETRLIMIT
48static void
49get_lim_data (void)
50{
51 struct rlimit rlimit;
52
53 getrlimit (RLIMIT_AS, &rlimit);
54 if (rlimit.rlim_cur == RLIM_INFINITY)
55 lim_data = -1;
56 else
57 lim_data = rlimit.rlim_cur;
58}
59 48
60#else /* not HAVE_GETRLIMIT */ 49# ifndef RLIMIT_AS
61 50# define RLIMIT_AS RLIMIT_DATA
62#ifdef USG 51# endif
63 52
64static void 53static void
65get_lim_data (void) 54get_lim_data (void)
66{ 55{
67 extern long ulimit (); 56 /* Set LIM_DATA to the minimum of the maximum object size and the
68 57 maximum address space. Don't bother to check for values like
69 lim_data = -1; 58 RLIM_INFINITY since in practice they are not much less than SIZE_MAX. */
70 59 struct rlimit rlimit;
71 /* Use the ulimit call, if we seem to have it. */ 60 lim_data
72#if !defined (ULIMIT_BREAK_VALUE) || defined (GNU_LINUX) 61 = (getrlimit (RLIMIT_AS, &rlimit) == 0 && rlimit.rlim_cur <= SIZE_MAX
73 lim_data = ulimit (3, 0); 62 ? rlimit.rlim_cur
74#endif 63 : SIZE_MAX);
75
76 /* If that didn't work, just use the macro's value. */
77#ifdef ULIMIT_BREAK_VALUE
78 if (lim_data == -1)
79 lim_data = ULIMIT_BREAK_VALUE;
80#endif
81
82 lim_data -= (long) data_space_start;
83} 64}
84 65
85#else /* not USG */ 66#elif defined WINDOWSNT
86#ifdef WINDOWSNT
87 67
88#include "w32heap.h" 68#include "w32heap.h"
89 69
@@ -94,10 +74,8 @@ get_lim_data (void)
94 lim_data = reserved_heap_size; 74 lim_data = reserved_heap_size;
95} 75}
96 76
97#else 77#elif defined MSDOS
98#if !defined (BSD4_2) && !defined (CYGWIN)
99 78
100#ifdef MSDOS
101void 79void
102get_lim_data (void) 80get_lim_data (void)
103{ 81{
@@ -135,32 +113,9 @@ ret_lim_data (void)
135 get_lim_data (); 113 get_lim_data ();
136 return lim_data; 114 return lim_data;
137} 115}
138#else /* not MSDOS */
139static void
140get_lim_data (void)
141{
142 lim_data = vlimit (LIM_DATA, -1);
143}
144#endif /* not MSDOS */
145
146#else /* BSD4_2 || CYGWIN */
147
148static void
149get_lim_data (void)
150{
151 struct rlimit XXrlimit;
152
153 getrlimit (RLIMIT_DATA, &XXrlimit);
154#ifdef RLIM_INFINITY
155 lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
156#else 116#else
157 lim_data = XXrlimit.rlim_cur; /* soft limit */ 117# error "get_lim_data not implemented on this machine"
158#endif 118#endif
159}
160#endif /* BSD4_2 */
161#endif /* not WINDOWSNT */
162#endif /* not USG */
163#endif /* not HAVE_GETRLIMIT */
164 119
165/* Verify amount of memory available, complaining if we're near the end. */ 120/* Verify amount of memory available, complaining if we're near the end. */
166 121