From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: dangling markers Date: Fri, 28 Jun 2024 18:47:22 +0200 Message-ID: References: <87v81u85hv.fsf@localhost> <87frsx81m2.fsf@localhost> 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="4994"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier , emacs-devel@gnu.org, Eli Zaretskii , eller.helmut@gmail.com To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 28 18:48:25 2024 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 1sNElr-00013q-JX for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Jun 2024 18:48:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNEl3-0007hm-T9; Fri, 28 Jun 2024 12:47:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNEkx-0007fN-3e for emacs-devel@gnu.org; Fri, 28 Jun 2024 12:47:28 -0400 Original-Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNEkv-0003jB-Jj; Fri, 28 Jun 2024 12:47:26 -0400 Original-Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a7194ce90afso94478366b.2; Fri, 28 Jun 2024 09:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719593244; x=1720198044; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=incbDP/PdciZP7GNoVfbIDonPIochhmGJXra4C1N2EM=; b=V3pH9lUJCKEjV2H6gXZF1BnJCU9npG2YgUS3UMPvgcb15XZWcs2xMe24oQotxJYARv WQPtjm3YSkrIUalSUG9bZjexjG6rFqxd7NfAUZ95CI4AtpD7Uowzrhn191AYIKy6jSMH nRoiCGxjwXU9rfJfNd8ngWnQGiggCcz3IlfURMZoBYRbcRFH8ojrAKoFgaq+0xgMNgyQ 51sHPQkXdw0cH8g0u+1Ev9P2cuWIawaFq4bKriecdzIiX7rnXiKB1ccalVDw4sfzYf3u ZCCcA051QQQCYkK+jxO3frvrH3SfSd2l4rgcaXVKxPNsZIPNZsR6vkRa/DUIWE6+78cQ QRyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719593244; x=1720198044; 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:message-id:reply-to; bh=incbDP/PdciZP7GNoVfbIDonPIochhmGJXra4C1N2EM=; b=eMzwsDxl0h8B/ujXyOC0ZjE2F6gnhTZYEE4MN+zrpNn1Rid0cqwnTt6SMdVdODHImx 3hTMEmf6fGeZasI1E/PI9cgujSqA2KeT3FJbxrfb1/EAMlIrNOqNCdX5D6x5bMkAE8eX wG3SjhlRc/1DHqNTCVnmdOdHcyJMADMy+8U5XFUTS19A1IVQV1bHnIW5KcNqHILBQzSC lSQ0vFLEhhCGgbRbO6CjkXDMaLhYVOc/3hdWwCAyaYrQPzX+jjRZ89UkKYTj+B5B+zHd pYj17r+rSr8Qd3fiPL475e9Buh9oeoz+4gAMMF/TlLVAihraClbzBbdliR+jix07hFQz kmEw== X-Forwarded-Encrypted: i=1; AJvYcCW0RMzlTfwl90MlP8beKhEWPIC4by4oP5/G/ygjucYhGMOsoWOz5frpoSvGxXGaV5ItIAm4aSuNlB3nULnUz9uuXDjve8GSZI58W4s8+tBVIkc= X-Gm-Message-State: AOJu0YylokbTGY43s5fKJjaCTjRFDVBT/jbYO8lhtdcbbJQk7DkpzcVc 1fs1R9SHWspgN+TWAo8uzMJ7f4jWwu8M3mcsFIgK0Uzuoy+PTFhg X-Google-Smtp-Source: AGHT+IEPHVrfSrbVbhuDSJuBxi2YQ4f7KL08/MTzC6Z9+VGl+kNROjO0gYm3y84WDXqynIBSF66eqA== X-Received: by 2002:a17:906:1c4a:b0:a71:2b4b:29b5 with SMTP id a640c23a62f3a-a7165477ee9mr1083228966b.70.1719593243382; Fri, 28 Jun 2024 09:47:23 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e360da.dip0.t-ipconnect.de. [217.227.96.218]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab0651c0sm92532266b.123.2024.06.28.09.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 09:47:22 -0700 (PDT) In-Reply-To: <87frsx81m2.fsf@localhost> (Ihor Radchenko's message of "Fri, 28 Jun 2024 16:37:41 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320825 Archived-At: Ihor Radchenko writes: > Gerd M=C3=B6llmann writes: > >>> AFAIK, markers are the only one that can be reachable (i.e. we may >>> spend time looking at them) yet GC-able, because the buffers' `markers` >>> slot contains a linked-list of all markers that's treated specially by >>> the GC (basically, the list is "weak" so markers get removed from this >>> list during GC if the marker is reachable only from the list). >> >> Exactly. > > I looked closer into the version of buf_charpos_to_bytepos in > scratch/igc, and I notice that > > # define DO_MARKERS(b, m) = \ > for (struct marker_it it_ =3D marker_it_init (b); marker_it_valid (&it_= ); \ > marker_it_next (&it_)) \ > for (struct Lisp_Marker *m =3D marker_it_marker (&it_); m; m =3D NULL) > > is a double loop, which is different from version of master (master has > a single for loop). It's only a syntactic trick to get M declared. Please note that the inner for runs exactly onee.