From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#58158: 29.0.50; [overlay] Interval tree iteration considered harmful Date: Thu, 29 Sep 2022 09:03:17 +0200 Message-ID: References: <83h70qhez0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38802"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: 58158@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 29 09:04:22 2022 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 1odnao-0009wS-7t for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 09:04:22 +0200 Original-Received: from localhost ([::1]:49676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odnam-0006Gq-LE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 03:04:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odnaU-0006Dz-A4 for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 03:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odnaT-0002FQ-WD for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 03:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odnaT-0008Jk-Qb for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 03:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Sep 2022 07:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58158 X-GNU-PR-Package: emacs Original-Received: via spool by 58158-submit@debbugs.gnu.org id=B58158.166443500931917 (code B ref 58158); Thu, 29 Sep 2022 07:04:01 +0000 Original-Received: (at 58158) by debbugs.gnu.org; 29 Sep 2022 07:03:29 +0000 Original-Received: from localhost ([127.0.0.1]:35776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odnZw-0008Ii-VF for submit@debbugs.gnu.org; Thu, 29 Sep 2022 03:03:29 -0400 Original-Received: from mail-ed1-f52.google.com ([209.85.208.52]:43776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odnZv-0008IU-04 for 58158@debbugs.gnu.org; Thu, 29 Sep 2022 03:03:27 -0400 Original-Received: by mail-ed1-f52.google.com with SMTP id y8so687272edc.10 for <58158@debbugs.gnu.org>; Thu, 29 Sep 2022 00:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=3w39RTklEdnIqFOJPGt4SKJM69eEAjS/NXaSwwmYf6Q=; b=gabWP0fCZ7RHCZCRKSx3xT0s/x9DFUgvav0vpm+K7ZrZ4XpyqKQliWcR2KuwWp8fWV +kvspsQqrogO5eHcQX8KhipknSqSYMRtzvaCCSlGuv0z8HX2axjQ0UlAgE+5mGXuEXjj iBkLjyJaomjmNpnP8eJzuRmNFQhPSDLg6yWz1JYeznZPp1jyp+DPqJc+L8rO7VhaZEG0 wAUoQZBGZrybWZRy0DgAKRn7lpMEvm3NzIK1beGbVqGcFfYRYZqc6VEcBZ04Hxf9e6F3 WcDf/x7naITxIN1ywPq8hsQb1ahbVuFwlDETB1oQRhK5GS3oeI2FqHbhtX08H/V9QhZp 96uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date; bh=3w39RTklEdnIqFOJPGt4SKJM69eEAjS/NXaSwwmYf6Q=; b=kbWtWrTy+NrOCkh3LZwwO3ATRt9MFQoSpriJIeMsE7O9YmQyC7MLvb+c99OVjIVsRV 0FOoxGvlGzYnSGJ0RnFEHOVgz4aNqWZ+lXsGJtTimypfWdeJBivqRtInYP0Eyh94D/vK jto3Ygl/BHOtHIWCv+GS02efT5ZA6yw2r3aesp6gV8C1BconGg6Nmu9aR5qAVRTWV7/9 NYNNiq3aD3PgJrn9GuIWVFUoR+txnNmxtnb8xFaWohyfDRy6CSNvTudDe3czBW2L2Ym2 Q4oIN/0D05XOsCJ84RY3N1oeVANOmAGCRcjV/OhuFxxUxaooEQtu4es7Tr5umTR8LEi1 r/Sw== X-Gm-Message-State: ACrzQf1UGloriOmjxFAsUzHdQrrzagRSXz629d56q/IMvHjJtlGSE90K j4PFPyxN5sxKbgbaNhdCV+JQWkMkSXAUzw== X-Google-Smtp-Source: AMsMyM4GCblqbiFSPF9MnZp+O/EZmjJkQk6tztAsOZtswavyY3rMp21p/DLM5I9UEKv0d86srGEb7g== X-Received: by 2002:aa7:cd76:0:b0:457:cada:6cb7 with SMTP id ca22-20020aa7cd76000000b00457cada6cb7mr1795674edb.369.1664435000456; Thu, 29 Sep 2022 00:03:20 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36935.dip0.t-ipconnect.de. [217.227.105.53]) by smtp.gmail.com with ESMTPSA id e11-20020a170906080b00b0073c8d4c9f38sm3653342ejd.177.2022.09.29.00.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 00:03:19 -0700 (PDT) In-Reply-To: <83h70qhez0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 29 Sep 2022 09:28:03 +0300") 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:243874 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Date: Thu, 29 Sep 2022 07:29:25 +0200 >>=20 >> In its current form, interval tree iteration works like this: >>=20 >> 1. Call begin_iteration(T) to iterate over tree T >> 2. do stuff >> 3. Call end_iteration(T) >>=20 >> with the following rules: >>=20 >> - Begin_iteration and end_iteration must be paired. >>=20 >> - There can be only one iteration per tree at a time. Nested iteration >> over the same tree is not supported (abort). >>=20 >> - No GC may happen in step 2. This is because mark_buffer iterates over >> buffer overlays. >>=20 >> I think this is an exceedingly dangerous design. > > Why, because of "no GC" requirement? We could ensure that by calling > inhibit_garbage_collection (if the code doesn't do that already). It doesn't. BTW, if anything signals in step 2, so that end_iteration isn't called, we're also hosed. > What higher-level operations require "interval tree iteration" that > you describe? Which primitives end up doing such iterations? What has to do with overlays. To name a few: overlay-at, overlays-in, next-overlay-change, previous-overlay-change, overlay-lists, ... I personally think this is a no-go.