From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Enlarge MAX_ALLOCA? Date: Thu, 19 Jun 2014 16:37:07 -0400 Message-ID: References: <83sin0sx98.fsf@gnu.org> <83lhsssq1b.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403210263 28190 80.91.229.3 (19 Jun 2014 20:37:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Jun 2014 20:37:43 +0000 (UTC) Cc: Kenichi Handa , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 19 22:37:36 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wxj5T-0007Ev-HH for ged-emacs-devel@m.gmane.org; Thu, 19 Jun 2014 22:37:35 +0200 Original-Received: from localhost ([::1]:37822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxj5S-0000K0-QT for ged-emacs-devel@m.gmane.org; Thu, 19 Jun 2014 16:37:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxj5I-0000Fu-Ct for emacs-devel@gnu.org; Thu, 19 Jun 2014 16:37:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxj5A-0002R3-S9 for emacs-devel@gnu.org; Thu, 19 Jun 2014 16:37:24 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:31158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxj52-0002Py-PL; Thu, 19 Jun 2014 16:37:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOASjKoVvgWqDTCE X-IPAS-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOASjKoVvgWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="68410215" Original-Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 19 Jun 2014 16:37:07 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 615CE60D16; Thu, 19 Jun 2014 16:37:07 -0400 (EDT) In-Reply-To: <83lhsssq1b.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 19 Jun 2014 21:38:40 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172546 Archived-At: >> It makes the potential max increment of stack space "per >> lisp-eval-depth" larger, and hence increases the risk that we'll eat up >> our stack before we bump into max-lisp-eval-depth. > Which functions relevant to max-lisp-eval-depth use SAFE_ALLOCA? I don't know. Maybe none, but that would surprise me. >> I think it makes a lot of sense to try and allocate this space on the >> stack when decoding file names, but why does it allocate such a huge >> buffer just to en/decode a puny file name? > That buffer is fixed in size, I don't know why. Perhaps it's hard to > know in advance how much we will need. Supposedly, every coding system comes with a "blow up factor" (can't remember the name we use) which should be usable to compute a safe upper-bound. > I hope Handa-san could explain. Handa? > Again, the problem is memory fragmentation and the resulting large > footprint, not the cost of the allocation. Is this memory fragmentation problem hypothetical, or have we seen evidence of it? Stefan