From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Emacs-diffs Digest, Vol 94, Issue 89 Date: Sat, 25 Sep 2010 09:50:05 +0200 Organization: Organization?!? Message-ID: <87tylexnwy.fsf@lola.goethe.zz> References: <83zkv7rmpe.fsf@gnu.org> <83tylesyyk.fsf@gnu.org> <83r5gisxmp.fsf@gnu.org> <87fwwyzy0h.fsf@lola.goethe.zz> <83k4mas2s5.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285401029 2472 80.91.229.12 (25 Sep 2010 07:50:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 07:50:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 09:50:27 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzPWd-0000XA-LG for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 09:50:27 +0200 Original-Received: from localhost ([127.0.0.1]:39689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzPWd-0008Vs-4k for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 03:50:27 -0400 Original-Received: from [140.186.70.92] (port=60706 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzPWV-0008UY-Rm for emacs-devel@gnu.org; Sat, 25 Sep 2010 03:50:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzPWU-00049X-Oa for emacs-devel@gnu.org; Sat, 25 Sep 2010 03:50:19 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:50909) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzPWU-000498-F8 for emacs-devel@gnu.org; Sat, 25 Sep 2010 03:50:18 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OzPWQ-0000UA-F3 for emacs-devel@gnu.org; Sat, 25 Sep 2010 09:50:14 +0200 Original-Received: from p508ebf48.dip.t-dialin.net ([80.142.191.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Sep 2010 09:50:14 +0200 Original-Received: from dak by p508ebf48.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Sep 2010 09:50:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ebf48.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:Ul1efxBNGfJNc8WTLXcYtCEVbEc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130833 Archived-At: Eli Zaretskii writes: >> From: David Kastrup >> Date: Fri, 24 Sep 2010 22:29:02 +0200 >> >> Eli Zaretskii writes: >> >> > Or maybe you mean that Stefan thought casting was not the best idea. >> > In that case, I'd like Stefan's opinion on this one: >> > >> >> - int frame_lines = FRAME_LINES (frame); >> >> + EMACS_INT frame_lines = FRAME_LINES (frame); >> > >> > I think down that lane lies madness, because we have lots of struct >> > members that are Lisp integers, and assigning the result of XINT of >> > every one of them to an EMACS_INT will significantly and unnecessarily >> > increase our stack usage (on 64-bit machines). >> >> "Significantly"? Reality check. > > Yes, indeed. Take a look at GC some day, it uses up tens of thousands > of recursive calls as a matter of routine. And how many of those garbage collection calls are involved in this particular issue? About zero I should guess. > And even without GC, there are about 30 frames on the stack any time I > debug Emacs. Of which there are, pessimistically speaking, probably 10 affected. So we are talking about several dozens of wasted bytes at any given point of time. Very much dwarved by the stack requirements of garbage collection, according to you. > If we pacify -Wconversion by using EMACS_INT for every variable that > sometimes gets assigned the result of XINT or XFASTINT, that could be > quite a lot of memory waste. We are talking about automatic variables here. When optimizing, the compiler does not even reserve stack space when it does not need it. In fact, you are likely getting code bloat if you force intermediate values into variables of smaller size than the original type. The compiler works with 64-bit registers in the affected architectures, anyway, and it needs to fiddle with masking/extending operations in order to simulate 32-bit variables. It generates extra code in order to produce the behavior that the compiler warns about. -- David Kastrup