From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Failing to GC killed buffers considered harmful Date: Tue, 31 Mar 2020 12:52:48 -0400 Message-ID: References: <838sjj5jg9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="5065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , Daniel Colascione , emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 31 18:53:41 2020 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 1jJK8z-0001Dg-0I for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Mar 2020 18:53:41 +0200 Original-Received: from localhost ([::1]:41744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJK8y-00036Q-1F for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Mar 2020 12:53:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45291) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJK8F-0002Nu-3z for emacs-devel@gnu.org; Tue, 31 Mar 2020 12:52:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJK8D-000306-Mr for emacs-devel@gnu.org; Tue, 31 Mar 2020 12:52:54 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36693) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJK8C-0002xk-4Y; Tue, 31 Mar 2020 12:52:52 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 20992100C06; Tue, 31 Mar 2020 12:52:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 85C0F100925; Tue, 31 Mar 2020 12:52:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1585673569; bh=4YmuezLcqC8jk8f7miZ17bxnGJ2Xg+h8yU4/kWvBDpI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Mgw0qqMk/+cB2WlnvDQFuFrmDFq5qC7lOCq4QazkLP22kvy9dK8DT7eI62WpSfDoI zh+1MrxOCiqnpRXGIz5MXrdIHyHjKbl2b9qsDLNDYT4WnGpoFSCFZ2uuxLo52TcEX/ Dvlwb0+V8RBHufNdoBPKlv8yFFcqpwzeFvr59A76SL0CWe4AtjF4L6IlpXFq6x8O/c 4Qf4M43lnVJtOyaWYsFZ3q92GpzG/kS1rK+eV5gCRR7aajNdeOg+F5qvPM4oWobkqN huu2rexZ67QeFBDDCfFSmCs1hXNJy5cT12TVqYIH7ngoJSxwT+PJ7dZu5nz1Y5MHZk RRJIgkYzT3/JQ== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 47C02120839; Tue, 31 Mar 2020 12:52:49 -0400 (EDT) In-Reply-To: (Pip Cet's message of "Tue, 31 Mar 2020 14:58:20 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:246122 Archived-At: >> The patch below seems to work. > But it changes gcstat definitions (killed buffers are no longer > counted towards total_buffers). Indeed (instead all the `struct buffer` objects are now included in the count of (pseudo)vectors). I find this of no consequence and I don't think the GC algorithm should adapt to the gcstat (it should be the other way around). >> The only worrisome part I think is that `live_buffer_holding` allowed >> pointers into buffer objects, whereas `live_vector_p` only treats >> pointers to the beginning of the object as a valid reference. > Uh, I don't see how the second part of that statement is true. Indeed it's not. I had forgotten that Paul had also changed the live_vector_holding code in the same way. Great! >> Not sure why buffers would be more likely to have valid pointers into >> them (and can't remember discussions about that either), > buffer text. The buffer text is not stored within the `struct buffer` object, so no. But that's irrelevant since I was confused anyway. >> so I assume the difference was not important (it just happened to be >> easier to support that for buffers). > Which difference, I still don't understand. You do ;-) > Next, it might be nice to have anonymous buffers that are > garbage-collected automatically and don't need to be killed. *ducks* Did I hear something or was it just the wind? Stefan