From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 1392ec7 2/3: A quicker check for quit Date: Tue, 31 Jan 2017 11:31:33 -0500 Message-ID: References: <20170126052541.29089.5382@vcs.savannah.gnu.org> <20170126052542.828422201BC@vcs.savannah.gnu.org> <83h94hydrs.fsf@gnu.org> <0faac5e6-d857-2afd-d05a-5fcb991419f0@cs.ucla.edu> <8337g0y34h.fsf@gnu.org> <104bf888-821f-98d0-48d3-199cf942c839@cs.ucla.edu> <83fujzw7qa.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485883826 31009 195.159.176.226 (31 Jan 2017 17:30:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2017 17:30:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Paul Eggert , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 31 18:30:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYcG2-0007ju-CZ for ged-emacs-devel@m.gmane.org; Tue, 31 Jan 2017 18:30:18 +0100 Original-Received: from localhost ([::1]:39698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYcG7-00065N-Sf for ged-emacs-devel@m.gmane.org; Tue, 31 Jan 2017 12:30:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYbLM-0001jB-Km for emacs-devel@gnu.org; Tue, 31 Jan 2017 11:31:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYbLH-0003LY-LT for emacs-devel@gnu.org; Tue, 31 Jan 2017 11:31:44 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60469) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cYbLD-0003Kn-RT; Tue, 31 Jan 2017 11:31:35 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B8PAAu3EVY/0gvq8BdGwEBAQMBAQEJAQEBgzgBAQEBAR+EW4VUnAImAZZehhwEAgKCEUQQAQIBAQEBAQEBYihCEgGEFAEEAVYjEAs0EhQYDSSIegitFItEAQEBAQYCASSLGYopBY98imqbGoY6kg82IHgTDoVzIIYxgnwBAQE X-IPAS-Result: A0B8PAAu3EVY/0gvq8BdGwEBAQMBAQEJAQEBgzgBAQEBAR+EW4VUnAImAZZehhwEAgKCEUQQAQIBAQEBAQEBYihCEgGEFAEEAVYjEAs0EhQYDSSIegitFItEAQEBAQYCASSLGYopBY98imqbGoY6kg82IHgTDoVzIIYxgnwBAQE X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="291663570" Original-Received: from 192-171-47-72.cpe.pppoe.ca (HELO pastel.home) ([192.171.47.72]) by smtp.teksavvy.com with ESMTP; 31 Jan 2017 11:31:33 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 9629165786; Tue, 31 Jan 2017 11:31:33 -0500 (EST) In-Reply-To: <83fujzw7qa.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 31 Jan 2017 17:48:45 +0200") 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.21 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:211804 Archived-At: >>> regex.c calls maybe_quit internally, so why do we need this >>> additional call? >> >> The regex code does not always call maybe_quit. For example, without >> this additional call, (re-search-forward "[[:alpha:]]" nil nil >> most-positive-fixnum) would loop indefinitely in a buffer containing >> only alphabetic characters on a 64-bit platform. > > Then maybe we should add maybe_quit calls in regex.c instead? FWIW, in the case or (re-search-forward "[[:alpha:]]" nil nil most-positive-fixnum) the regexp matches themselves are constant-time operations, repeated in search.c, so it makes sense to put the maybe_quit in search.c rather than in regexp.c. Clearly both options will/would work, but I think the general design of maybe_quit is that we should not need to put one in code whose runtime is constant. IOW the maybe_quit calls should be on the backward-edges of loops which means that running a loop a single time may but does not need to call maybe_quit. Stefan