# HG changeset patch # User Andreas Schwab # Date 1217753523 0 # Node ID 96dac119813192c6ac300f94f9d84fb0bdc92cbe # Parent 1533ce04b4b895b9306c4f87ac5b39bb2d2df524 (check_memory_limits) [HAVE_GETRLIMIT]: Fix calculation of data_size. Use correct type for five_percent. diff -r 1533ce04b4b8 -r 96dac1198131 src/ChangeLog --- a/src/ChangeLog Sat Aug 02 22:35:21 2008 +0000 +++ b/src/ChangeLog Sun Aug 03 08:52:03 2008 +0000 @@ -1,3 +1,8 @@ +2008-08-03 Andreas Schwab + + * vm-limit.c (check_memory_limits) [HAVE_GETRLIMIT]: Fix + calculation of data_size. Use correct type for five_percent. + 2008-08-02 Chong Yidong * vm-limit.c (check_memory_limits): Don't use getrlimit on cygwin. diff -r 1533ce04b4b8 -r 96dac1198131 src/vm-limit.c --- a/src/vm-limit.c Sat Aug 02 22:35:21 2008 +0000 +++ b/src/vm-limit.c Sun Aug 03 08:52:03 2008 +0000 @@ -148,7 +148,11 @@ 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; @@ -163,7 +167,6 @@ || rlimit.rlim_cur > rlimit.rlim_max) return; five_percent = rlimit.rlim_max / 20; - data_size = rlimit.rlim_cur; #else /* not HAVE_GETRLIMIT */ @@ -171,6 +174,8 @@ 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) @@ -180,8 +185,6 @@ cp = (char *) (*__morecore) (0); data_size = (char *) cp - (char *) data_space_start; -#endif /* not HAVE_GETRLIMIT */ - if (!warn_function) return;