From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Possible memory corruption problem Date: Tue, 14 Feb 2006 23:39:55 -0500 Message-ID: References: <17393.41708.76191.538450@parhasard.net> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1139978535 6429 80.91.229.2 (15 Feb 2006 04:42:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Feb 2006 04:42:15 +0000 (UTC) Cc: piet@cs.uu.nl, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 15 05:42:13 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F9EUR-00021w-65 for ged-emacs-devel@m.gmane.org; Wed, 15 Feb 2006 05:42:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F9EUQ-0001QI-7C for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2006 23:42:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F9ESN-0006kT-3s for emacs-devel@gnu.org; Tue, 14 Feb 2006 23:39:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F9ESL-0006f4-6j for emacs-devel@gnu.org; Tue, 14 Feb 2006 23:39:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F9ESK-0006e6-OC for emacs-devel@gnu.org; Tue, 14 Feb 2006 23:39:56 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F9EX9-0001Sa-Sg for emacs-devel@gnu.org; Tue, 14 Feb 2006 23:44:55 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1F9ESJ-00023i-VK; Tue, 14 Feb 2006 23:39:56 -0500 Original-To: Aidan Kehoe In-reply-to: <17393.41708.76191.538450@parhasard.net> (message from Aidan Kehoe on Tue, 14 Feb 2006 10:29:16 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50552 Archived-At: 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 + + #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)