+2008-08-03 Andreas Schwab <schwab@suse.de>
+
+ * vm-limit.c (check_memory_limits) [HAVE_GETRLIMIT]: Fix
+ calculation of data_size. Use correct type for five_percent.
+
2008-08-02 Chong Yidong <cyd@stupidchicken.com>
* vm-limit.c (check_memory_limits): Don't use getrlimit on cygwin.
extern POINTER (*__morecore) ();
register POINTER cp;
+#if defined (HAVE_GETRLIMIT) && ! defined (CYGWIN)
+ rlim_t five_percent;
+#else
unsigned long five_percent;
+#endif
unsigned long data_size;
enum warnlevel new_warnlevel;
|| rlimit.rlim_cur > rlimit.rlim_max)
return;
five_percent = rlimit.rlim_max / 20;
- data_size = rlimit.rlim_cur;
#else /* not HAVE_GETRLIMIT */
get_lim_data ();
five_percent = lim_data / 20;
+#endif /* not HAVE_GETRLIMIT */
+
/* Find current end of memory and issue warning if getting near max */
#ifdef REL_ALLOC
if (real_morecore)
cp = (char *) (*__morecore) (0);
data_size = (char *) cp - (char *) data_space_start;
-#endif /* not HAVE_GETRLIMIT */
-
if (!warn_function)
return;