From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#48264: [PATCH v3 15/15] Add and use BVAR_FIELD macros Date: Sun, 9 May 2021 13:09:31 -0400 Message-ID: <20210509170933.27338-1-sbaugh@catern.com> References: <83im3s8gzq.fsf@gnu.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32243"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Spencer Baugh , monnier@iro.umontreal.ca, 48264@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 09 19:10:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lfmwV-0008GQ-0r for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 19:10:11 +0200 Original-Received: from localhost ([::1]:49484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfmwU-000515-0t for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 13:10:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfmwM-00050p-Vo for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 13:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfmwM-00005s-Oc for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 13:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfmwM-00063r-Jl for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 13:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 May 2021 17:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48264 X-GNU-PR-Package: emacs Original-Received: via spool by 48264-submit@debbugs.gnu.org id=B48264.162058018023276 (code B ref 48264); Sun, 09 May 2021 17:10:02 +0000 Original-Received: (at 48264) by debbugs.gnu.org; 9 May 2021 17:09:40 +0000 Original-Received: from localhost ([127.0.0.1]:56364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfmw0-00063L-5D for submit@debbugs.gnu.org; Sun, 09 May 2021 13:09:40 -0400 Original-Received: from venus.catern.com ([68.183.49.163]:36596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfmvx-000632-Sg for 48264@debbugs.gnu.org; Sun, 09 May 2021 13:09:39 -0400 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=98.7.229.235; helo=localhost; envelope-from=sbaugh@catern.com; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=catern.com; s=mail; t=1620580176; bh=3EuCn7RdL0nePul5SKgMz2od+rEH4RXFC0jYR8HF8i8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l5KRJexANO6Y6MFegKzgwxWAMrzoI8SwIMnr07oGFqrzewtqqgogLghkiTygQ0EaH 5ZhePY1PrjjKQa7ABYM+a2Op25ptfKy3kuiO3WVnQEeS+wV9/LCv9is64Xill3Cju8 RZ/qS+wrrDa7TBBtd8uPHj7mMPs+WH8lnejUno+s= Original-Received: from localhost (cpe-98-7-229-235.nyc.res.rr.com [98.7.229.235]) by venus.catern.com (Postfix) with ESMTPSA id 77EE02E92BC; Sun, 9 May 2021 17:09:36 +0000 (UTC) X-Mailer: git-send-email 2.31.1 In-Reply-To: <83im3s8gzq.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206093 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 48264@debbugs.gnu.org >> Date: Sat, 08 May 2021 15:03:46 -0400 >> >> Eli Zaretskii writes: >> >> From: Spencer Baugh >> >> Cc: 48264@debbugs.gnu.org >> >> Date: Sat, 08 May 2021 09:35:31 -0400 >> >> If you think such a conditionally-compiled runtime check would be >> >> acceptable for applying these changes, I can go ahead and write that. >> > >> > Yes, I think so. But if Lars or Stefan think differently, I might >> > reconsider. >> >> In the process of implementing the runtime check, I, of course, came up >> with a better compile-time check. How about this? > > LGTM, thanks. But could you please run your benchmarks again, with > this implementation, to make sure we still get only a 1 - 2% slowdown > at worst? I wouldn't expect the addition to matter in an optimized > build, but just to be sure... I ran the benchmarks again and got similar results. | | On master | With my changes | Slowdown | | shr-bench | 2.2865667967 | 2.2762716187 | -0.48% | | delete *.elc and make | 52m12.627s | 51m56.780s | -0.50% | | xdisp-bench | 6.1960484849 | 6.2269325793 | 0.49% | Here's the two patches that are needed to add this compile-time check; they apply cleanly on my v4 series, when the "Add and use BVAR_FIELD macros" patch is removed. Spencer Baugh (2): Take buffer field name in DEFVAR_PER_BUFFER Add compile-time check that BVAR is used correctly src/buffer.c | 140 ++++++++++++++++++++++++------------------------- src/buffer.h | 28 ++++++++-- src/category.h | 2 +- src/syntax.h | 2 +- 4 files changed, 94 insertions(+), 78 deletions(-) -- 2.31.1