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: Fri, 20 Jun 2014 09:02:19 -0400 Message-ID: References: <83sin0sx98.fsf@gnu.org> <83lhsssq1b.fsf@gnu.org> <83ionwrrc6.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403269380 18394 80.91.229.3 (20 Jun 2014 13:03:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2014 13:03:00 +0000 (UTC) Cc: handa@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 20 15:02:50 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 1WxySw-0007Hd-1l for ged-emacs-devel@m.gmane.org; Fri, 20 Jun 2014 15:02:50 +0200 Original-Received: from localhost ([::1]:40729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxySv-0002GQ-MI for ged-emacs-devel@m.gmane.org; Fri, 20 Jun 2014 09:02:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxySk-0002G4-Hn for emacs-devel@gnu.org; Fri, 20 Jun 2014 09:02:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxySc-0002uF-59 for emacs-devel@gnu.org; Fri, 20 Jun 2014 09:02:38 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:40104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxyST-0002qw-BI; Fri, 20 Jun 2014 09:02:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOI1cHhDgEoyqFb4Fqg0whgS0 X-IPAS-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOI1cHhDgEoyqFb4Fqg0whgS0 X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="68720062" 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; 20 Jun 2014 09:02:20 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E0AFE60D09; Fri, 20 Jun 2014 09:02:19 -0400 (EDT) In-Reply-To: <83ionwrrc6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jun 2014 10:08:09 +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:172564 Archived-At: > Alternatively, how about using a different limit just in the 2 users > of ALLOC_CONVERSION_WORK_AREA? Why not just use `alloca' directly for those cases, then? > I don't think the work area is what you think it is. It is not for > the result of the encoding/decoding; that is allocated elsewhere, and > indeed uses a dynamic size computed from the source size. This work > area is for something else: for handling composition annotations > (whatever that is). See handle_composition_annotation and > produce_annotation in coding.c. I see, then indeed I have no idea what that's about. >> > 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? > Hypothetical. I just don't like seeing such frequent sequences of > malloc(64K)/free() one after the other several times a second in a > live session. I'd expect any non-toy implementation of malloc/free to handle this without any serious risk of fragmentation, to tell you the truth. Stefan