From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH v2 15/16] Remove local_flags array in struct buffer Date: Tue, 01 Dec 2020 19:57:17 +0200 Message-ID: <83sg8ph0jm.fsf@gnu.org> References: <20201119153814.17541-1-sbaugh@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@catern.com, arnold@tdrhq.com, dgutov@yandex.ru, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 01 18:59:01 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kk9vY-0000j5-Is for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 18:59:00 +0100 Original-Received: from localhost ([::1]:55426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk9vX-0005V8-IS for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 12:58:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk9u0-0004Gy-UQ for emacs-devel@gnu.org; Tue, 01 Dec 2020 12:57:25 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59830) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk9tz-00085l-BH; Tue, 01 Dec 2020 12:57:23 -0500 Original-Received: from [176.228.60.248] (port=2057 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kk9ty-0002Ql-MB; Tue, 01 Dec 2020 12:57:23 -0500 In-Reply-To: (message from Spencer Baugh on Sat, 21 Nov 2020 21:34:44 -0500) 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:260152 Archived-At: > From: Spencer Baugh > Date: Sat, 21 Nov 2020 21:34:44 -0500 > Cc: Spencer Baugh , Arnold Noronha , > Stefan Monnier , Dmitry Gutov > > +#define BVAR_DIRECT(buf, field) ((buf)->field ## _) I think I'd prefer to call this BVAL instead. Or maybe leave this BVAR and rename the getter to something else. > @@ -963,8 +958,6 @@ reset_buffer (register struct buffer *b) > bset_display_count (b, make_fixnum (0)); > bset_display_time (b, Qnil); > bset_enable_multibyte_characters (b, Qt); > - bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type)); > - bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing)); Why are we removing these two? > @@ -1238,7 +1231,7 @@ buffer_local_value (Lisp_Object variable, Lisp_Object buffer) > { > lispfwd fwd = SYMBOL_FWD (sym); > if (BUFFER_OBJFWDP (fwd)) > - result = per_buffer_value (buf, XBUFFER_OBJFWD (fwd)->offset); > + result = bvar_get (buf, XBUFFER_OBJFWD (fwd)->offset); Indentation whitespace changes again. > +INLINE Lisp_Object > +bvar_get (struct buffer *b, ptrdiff_t offset) > +{ > + Lisp_Object val = per_buffer_value (b, offset); > + return EQ (val, Qunbound) > + ? per_buffer_default (offset) > + : val; > } Ouch! an inline function that calls another inline function, instead of a simple pointer dereference. Now I'm _really_ worried about the effect on performance. Can we make this faster, especially in unoptimized builds?