From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#54532: [PATCH] sorting Date: Thu, 24 Mar 2022 10:55:03 +0100 Message-ID: References: <320D86FD-5B2E-4177-9570-A8004A942E8C@acm.org> <831qyretr4.fsf@gnu.org> <87fsn7erw5.fsf@ust.hk> <83wngjd90r.fsf@gnu.org> <871qyrlnfv.fsf@ust.hk> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="846"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54532@debbugs.gnu.org To: Andrew Cohen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 24 10:56:20 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 1nXKCa-000Ad7-Gh for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Mar 2022 10:56:20 +0100 Original-Received: from localhost ([::1]:41952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXKCZ-0000qP-Ch for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Mar 2022 05:56:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXKCI-0000k5-Cm for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2022 05:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXKCI-0002pM-3W for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2022 05:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXKCH-0004GQ-Oc for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2022 05:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Mar 2022 09:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 54532-submit@debbugs.gnu.org id=B54532.164811571716334 (code B ref 54532); Thu, 24 Mar 2022 09:56:01 +0000 Original-Received: (at 54532) by debbugs.gnu.org; 24 Mar 2022 09:55:17 +0000 Original-Received: from localhost ([127.0.0.1]:46850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXKBZ-0004FO-BN for submit@debbugs.gnu.org; Thu, 24 Mar 2022 05:55:17 -0400 Original-Received: from mail1478c50.megamailservers.eu ([91.136.14.78]:60862 helo=mail118c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXKBW-0004F4-J2 for 54532@debbugs.gnu.org; Thu, 24 Mar 2022 05:55:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1648115707; bh=vbyTWcz4P5CPHrZ0FB8IRHtpihQ/PvDGaepsxSrf96Y=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=pv+isnbEtEawhlG+6TfXybT8RVdlobhSG43jpcUVxlh9tY8KChaczKUVTsml7MSmj W2K8Hh5IS+tST5kcBdky+mY+4HpBvBoy8JElGXmU/x2YJb4NrJV4D7HMiOWV3v/vQ6 KsXbMUfb6vG9Imqt8FbP03kDUlLomHSRYOdQZTBA= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c-b952e353.032-75-73746f71.bbcust.telenor.se [83.227.82.185]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 22O9t403030452; Thu, 24 Mar 2022 09:55:06 +0000 In-Reply-To: <871qyrlnfv.fsf@ust.hk> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A742F15.623C3FFB.000C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE 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:228870 Archived-At: 24 mars 2022 kl. 10.17 skrev Andrew Cohen : > No, I think they only get marked during the marking phase of a > GC. Mattias' implementation simply adds a callback to do the actual = marking > that is invoked in mark_specpdl: >=20 > case SPECPDL_UNWIND_PTR: > if (pdl->unwind_ptr.mark) > pdl->unwind_ptr.mark (pdl->unwind_ptr.arg); > break; Right -- it's really just a generalisation of the existing = `record_unwind_protect_ptr` and fills a gap that wasn't properly handled = before. The other unwind handlers in the family already take care of = marking: record_unwind_protect: takes a single Lisp_Object, which is marked. record_unwind_protect_array: takes a heap-allocated array of Lisp_Objects, which are all marked. record_unwind_protect_int: takes an int, which does not need marking. and so on. `record_unwind_protect_ptr` stands out because it takes a = generic pointer and unwind function, but does not account for the = possibility that anything referred to by that pointer may need marking. = `record_unwind_protect_ptr_mark` plugs that hole in a very natural way. I don't think we should disable the GC during sorting; the predicate = function is not restricted in what it can do. It could build data = structures, throw, call sort on another sequence, switch threads, and so = on.