From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Changes in GC and in pure space (was: [Emacs-diffs] master 5d4dd55: Fix lifetime error in previous patch) Date: Wed, 4 Sep 2019 09:56:11 -0700 Organization: UCLA Computer Science Department Message-ID: <5da094e5-b72f-b3a5-8eef-6904916cd5c2@cs.ucla.edu> References: <20190721193221.1964.53182@vcs0.savannah.gnu.org> <20190721193222.8C19E20BE2@vcs0.savannah.gnu.org> <83blxmqfkq.fsf@gnu.org> <9568ca7d-854f-1971-bbe8-03ba8c64af42@cs.ucla.edu> <83o9006rol.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="135586"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: dancol@dancol.org, pipcet@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 04 18:56:58 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i5YaV-000Z4x-M7 for ged-emacs-devel@m.gmane.org; Wed, 04 Sep 2019 18:56:55 +0200 Original-Received: from localhost ([::1]:35408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5YaU-00043A-Jx for ged-emacs-devel@m.gmane.org; Wed, 04 Sep 2019 12:56:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45971) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Ya2-000434-2p for emacs-devel@gnu.org; Wed, 04 Sep 2019 12:56:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5Ya0-0006zn-Sa for emacs-devel@gnu.org; Wed, 04 Sep 2019 12:56:25 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53258) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i5YZy-0006wl-TI; Wed, 04 Sep 2019 12:56:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CCAE5160057; Wed, 4 Sep 2019 09:56:17 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 2xZRqOTbEgfY; Wed, 4 Sep 2019 09:56:17 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EFEFF1600E6; Wed, 4 Sep 2019 09:56:16 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rjXyn9R6ol_8; Wed, 4 Sep 2019 09:56:16 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C3CA6160057; Wed, 4 Sep 2019 09:56:16 -0700 (PDT) In-Reply-To: <83o9006rol.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:239836 Archived-At: Eli Zaretskii wrote: > How portable is "INLINE" Quite portable, as its portability issues were shaken out years ago. It's been used in Emacs since 2013, and it's designed for C99-and-later so future C compilers should support it well. > (and if it's portable enough, why do we use a jmacro for it)? First, for convenience so that it's easier to follow the C rule that exactly one compilation unit must declare a function to be 'extern inline' if any compilation unit declares the function to be plain 'inline'. Second, for portability to C compilers that still do not support C99-style 'extern inline' (are these still significant? I don't offhand know). > I FWIW, personally find the issue of confusion about macro argument > evaluation to be a very weak one as justification to get rid of macros There are other reasons to avoid macros. Aside from the performance issue I mentioned in my buffer.h patch, debugging Emacs can be easier when C macros are avoided. On the Ubuntu 18.04.3 platform where I'm typing this message, when I'm using GDB to debug /usr/bin/emacs I can print expressions involving functions or constants but not expressions involving macros; this is because Ubuntu builds /usr/bin/emacs with -g instead of -g3. So avoiding macros helps make it easier to debug Emacs in my situation, which is common on GNUish platforms. Of course functions and constants cannot replace some C macros, such as INLINE. But many of Emacs's C macros ought to be functions or constants now, and this is not simply to avoid confusion.