aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab2008-08-03 08:52:03 +0000
committerAndreas Schwab2008-08-03 08:52:03 +0000
commita023b5598196cd84f98877f94e804c788aec7982 (patch)
tree41baff17acbcbb0db62d5f67141b4b054111f2d6 /src
parent21da04c4e9f97dde131a69d0c4e68405a65d6f88 (diff)
downloademacs-a023b5598196cd84f98877f94e804c788aec7982.tar.gz
emacs-a023b5598196cd84f98877f94e804c788aec7982.zip
(check_memory_limits) [HAVE_GETRLIMIT]: Fix
calculation of data_size. Use correct type for five_percent.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/vm-limit.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 015ecf02094..4f7354dd6aa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-08-03 Andreas Schwab <schwab@suse.de>
2
3 * vm-limit.c (check_memory_limits) [HAVE_GETRLIMIT]: Fix
4 calculation of data_size. Use correct type for five_percent.
5
12008-08-02 Chong Yidong <cyd@stupidchicken.com> 62008-08-02 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * vm-limit.c (check_memory_limits): Don't use getrlimit on cygwin. 8 * vm-limit.c (check_memory_limits): Don't use getrlimit on cygwin.
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 7628d29b607..348fccbb827 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -148,7 +148,11 @@ check_memory_limits ()
148 extern POINTER (*__morecore) (); 148 extern POINTER (*__morecore) ();
149 149
150 register POINTER cp; 150 register POINTER cp;
151#if defined (HAVE_GETRLIMIT) && ! defined (CYGWIN)
152 rlim_t five_percent;
153#else
151 unsigned long five_percent; 154 unsigned long five_percent;
155#endif
152 unsigned long data_size; 156 unsigned long data_size;
153 enum warnlevel new_warnlevel; 157 enum warnlevel new_warnlevel;
154 158
@@ -163,7 +167,6 @@ check_memory_limits ()
163 || rlimit.rlim_cur > rlimit.rlim_max) 167 || rlimit.rlim_cur > rlimit.rlim_max)
164 return; 168 return;
165 five_percent = rlimit.rlim_max / 20; 169 five_percent = rlimit.rlim_max / 20;
166 data_size = rlimit.rlim_cur;
167 170
168#else /* not HAVE_GETRLIMIT */ 171#else /* not HAVE_GETRLIMIT */
169 172
@@ -171,6 +174,8 @@ check_memory_limits ()
171 get_lim_data (); 174 get_lim_data ();
172 five_percent = lim_data / 20; 175 five_percent = lim_data / 20;
173 176
177#endif /* not HAVE_GETRLIMIT */
178
174 /* Find current end of memory and issue warning if getting near max */ 179 /* Find current end of memory and issue warning if getting near max */
175#ifdef REL_ALLOC 180#ifdef REL_ALLOC
176 if (real_morecore) 181 if (real_morecore)
@@ -180,8 +185,6 @@ check_memory_limits ()
180 cp = (char *) (*__morecore) (0); 185 cp = (char *) (*__morecore) (0);
181 data_size = (char *) cp - (char *) data_space_start; 186 data_size = (char *) cp - (char *) data_space_start;
182 187
183#endif /* not HAVE_GETRLIMIT */
184
185 if (!warn_function) 188 if (!warn_function)
186 return; 189 return;
187 190