emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible memory corruption problem


From: Richard M. Stallman
Subject: Re: Possible memory corruption problem
Date: Tue, 14 Feb 2006 23:39:55 -0500

Does this change do the job?  (Of course, we would put HAVE_GETRLIMIT
under the control of configure.)

*** vm-limit.c  07 Feb 2006 18:13:40 -0500      1.16
--- vm-limit.c  14 Feb 2006 22:57:45 -0500      
***************
*** 32,37 ****
--- 32,40 ----
  #endif
  
  #include "mem-limits.h"
+ #include <sys/resource.h>
+ 
+ #define HAVE_GETRLIMIT
  
  /*
    Level number of warnings already issued.
***************
*** 61,66 ****
--- 64,82 ----
    unsigned long five_percent;
    unsigned long data_size;
  
+ #ifdef HAVE_GETRLIMIT
+   struct rlimit {
+     rlim_t rlim_cur;
+     rlim_t rlim_max;
+   } rlimit;
+ 
+   getrlimit (RLIMIT_DATA, &rlimit);
+ 
+   five_percent = rlimit.rlim_max / 20;
+   data_size = rlimit.rlim_cur;
+ 
+ #else /* not HAVE_GETRLIMIT */
+ 
    if (lim_data == 0)
      get_lim_data ();
    five_percent = lim_data / 20;
***************
*** 73,78 ****
--- 89,96 ----
  #endif
    cp = (char *) (*__morecore) (0);
    data_size = (char *) cp - (char *) data_space_start;
+ 
+ #endif /* not HAVE_GETRLIMIT */
  
    if (warn_function)
      switch (warnlevel)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]