From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Kehoe Newsgroups: gmane.emacs.devel Subject: Re: Possible memory corruption problem Date: Tue, 14 Feb 2006 10:29:16 +0100 Message-ID: <17393.41708.76191.538450@parhasard.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1139909451 9767 80.91.229.2 (14 Feb 2006 09:30:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2006 09:30:51 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 14 10:30:49 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 1F8wW0-0003VW-Kx for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2006 10:30:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F8wVz-0000Ks-MH for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2006 04:30:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F8wUq-0000J5-6Z for emacs-devel@gnu.org; Tue, 14 Feb 2006 04:29:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F8wUo-0000H7-Gk for emacs-devel@gnu.org; Tue, 14 Feb 2006 04:29:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F8wUo-0000Gg-1a for emacs-devel@gnu.org; Tue, 14 Feb 2006 04:29:18 -0500 Original-Received: from [66.111.49.30] (helo=icarus.asclepian.ie) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F8wZR-00071g-TF for emacs-devel@gnu.org; Tue, 14 Feb 2006 04:34:06 -0500 Original-Received: by icarus.asclepian.ie (Postfix, from userid 1003) id 2BA8D8008C; Tue, 14 Feb 2006 09:29:16 +0000 (GMT) Original-To: Piet van Oostrum In-Reply-To: X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid X-Echelon-distraction: Reflection GEOS Taliban Ortega DynCorp Albanian 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:50519 Archived-At: Ar an ceathr=C3=BA l=C3=A1 d=C3=A9ag de m=C3=AD Feabhra, scr=C3=ADobh Pi= et van Oostrum:=20 > >>> Emacs tries to estimate how much memory is available, but that est= imate > >>> may not really work. For instance, it never works for me. > >>> The code to estimate available space worked in the 80s on Unix, > >>> but it may need adaptation to the systems of today. Ben Wing implemented this in XEmacs by looking at what getrlimit(2) retur= ns, which is effective and consistent with what modern OSes do. He also abstracted it to fall back to ulimit if that=E2=80=99s not available, or = to use the Win32-specific procedure when that=E2=80=99s appropriate.=20 > >EZ> It's possible that the existing estimate doesn't work on systems = that > >EZ> don't use sbrk. I believe GNU/Linux is one of those systems. >=20 > It seems it is not used on Mac OS X either. The man page says: > The brk and sbrk functions are historical curiosities left over f= rom > ear- lier days before the advent of virtual memory management. >=20 > And I run a test program with malloc calls, set a breakpoint at brk an= d > sbrk and it did not reach those. Which is well and good; implementing a heap using mmap, for example, mean= s you can release memory back to the OS once it=E2=80=99s been freed.=20 --=20 I AM IN JAIL AND ALLOWED SEND ONLY ONE CABLE SINCE WAS ARRESTED WHILE MEASURING FIFTEEN FOOT WALL OUTSIDE PALACE AND HAVE JUST FINISHED COUNTIN= G THIRTY EIGHT THOUSAND FIVE HUNDERED TWENTY TWO NAMES WHOS WHO IN MIDEAST.