From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#75322: SAFE_ALLOCA assumed to root Lisp_Objects/SSDATA(string) Date: Sun, 05 Jan 2025 19:31:06 +0200 Message-ID: <86o70l6ucl.fsf@gnu.org> References: <87jzbbke6u.fsf@protonmail.com> <86sepx8sth.fsf@gnu.org> <86h66d8pnl.fsf@gnu.org> <86ed1h8nji.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1346"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pipcet@protonmail.com, 75322@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 18:32:21 2025 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 1tUUU8-0000Dv-W4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 18:32:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUUTr-0004MB-Qw; Sun, 05 Jan 2025 12:32:03 -0500 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 1tUUTq-0004M1-9H for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 12:32:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUUTq-0000p0-0w for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 12:32:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=PyjhHlkuQCVyDnEuXv/eSv/H9Gms/F0vNbAdAv5QRLg=; b=nZBCPzYRIEezOMM7quRGzO8j9zWfX0A2tNBeza8Q84ceuzqE8yoaiwGn8ULn1gxki6GQlqshcpMSSeB2w6/y8gNFbzb4v0QHdyOPCmLnkWQ9lmKylZrZdMJdGmerAEXAiyj6+2RLyEVRj+Bb55QNkVYeWNCSLI2VPqu1aGgn0LfCoADBnrfbLvdqJY8xVGhduwYGXzVoc3MpPwTsG6NXZLzqfA9QsakK4Ib+n8Mh2+6fNSpTF6cVgetH8880JDZLAr8uozZYtOfrMSo7Wyg2s5lRimhAIaDuCmOx2w/B6FpGP/VjJlC7U1G9ZQDl+OYCOQ4fEjo4f01UuCJ5jgZP5A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUUTp-0007B8-Ra for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 12:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 17:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75322 X-GNU-PR-Package: emacs Original-Received: via spool by 75322-submit@debbugs.gnu.org id=B75322.173609827627520 (code B ref 75322); Sun, 05 Jan 2025 17:32:01 +0000 Original-Received: (at 75322) by debbugs.gnu.org; 5 Jan 2025 17:31:16 +0000 Original-Received: from localhost ([127.0.0.1]:35016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUUT5-00079n-Pe for submit@debbugs.gnu.org; Sun, 05 Jan 2025 12:31:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46540) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUUT4-00079Z-Bl for 75322@debbugs.gnu.org; Sun, 05 Jan 2025 12:31:14 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUUSy-0000le-IV; Sun, 05 Jan 2025 12:31:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=PyjhHlkuQCVyDnEuXv/eSv/H9Gms/F0vNbAdAv5QRLg=; b=NRrxuIW2jgT3V5uzRHy9 PLOcUAw743QNjCzgWp6QQKzJQ0d5FbqsMFIZB0ZBm3i7GCF4F+6poQZ0q4sEQcxLHI3LZjZHA1XtK wcWYJcaLjYzVDyN5dCCLvP9tfeL1mRBOZUUG/J7sKnHHXfaXUE9tStExpM6yWiR6juFwQ95AuwX2Z /gxz1ijNVXZUygO36QBmwizEtzh44FiwNpNLAD/9Ukcjn9DccQH428bBlmNZL9r/KTWpgIX2EJsgY dfOeMXWHUlz0C0GQs+WUu3qhieINEMlCBJMI21OgoIUMr4F37xq711+/Sju1BANouiiJATqCtcAK9 CdJ3BE+RXN5xBA==; In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Sun, 05 Jan 2025 14:21:04 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298577 Archived-At: > From: Gerd Möllmann > Cc: pipcet@protonmail.com, 75322@debbugs.gnu.org > Date: Sun, 05 Jan 2025 14:21:04 +0100 > > Eli Zaretskii writes: > > > So can we talk about the relative merits and demerits of using > > SAFE_ALLOCA_LISP vs SAFE_NALLOCA? > > Let me add a (0): I assume that SAFE_ALLOCA_LISP is the right thing in > the _old_ GC, because it makes sure objects referenced in the xmalloc'd > memory are marked. From my POV, it would require a very good reason to > use something else, which is nowhere mentioned. That's why I suspect > it's a left-over from times where SAFE_ALLOCA_LISP didn't exist. This surprises me because on the master branch SAFE_ALLOCA_LISP either calls alloca or xzalloc. So I don't see why SAFE_ALLOCA_LISP would be safer in the old GC than SAFE_NALLOCA. It's only on the igc branch that you made SAFE_ALLOCA_LISP make a Lisp vector. But this is a tangent from my POV. I would like to discuss the new GC, not the old one. > > And second, SAFE_ALLOCA_LISP conses a Lisp vector, which will increase > > GC pressure, so isn't SAFE_NALLOCA preferable at least in some cases? > > SAFE_ALLOCA_LISP allocates a Lisp vector, that's true. I think one can > say that allocation is cheap on average. The overhead of freeing it is > not copying it, which is basically zero. But I presume that if we have more Lisp objects, GC will happen sooner, no? So increasing GC pressure is not zero-cost, because more frequent GC means more CPU processing that stops our application thread. > SAFE_NALLOCA, with my patch, requires a xmalloc, creation of a MPS root > object, deletion of that, and xfree. > > Let's assume scanning costs are more or less the same because the > number of references is the same in both cases. But more memory allocated via xmalloc doesn't increase the frequency of GC, does it?