From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#20907: [PATCH] Manual bug for scm_gc_protect_object Date: Wed, 02 Sep 2015 12:52:54 -0400 Message-ID: <87mvx4226x.fsf@netris.org> References: <87a8t5c9bf.fsf@gnu.org> <1975455902.407587.1441208174259.JavaMail.yahoo@mail.yahoo.com> <87r3mg23wc.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1441212864 7685 80.91.229.3 (2 Sep 2015 16:54:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 16:54:24 +0000 (UTC) Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 20907@debbugs.gnu.org To: Mike Gran Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Sep 02 18:54:14 2015 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZXBIa-0008Ql-5k for guile-bugs@m.gmane.org; Wed, 02 Sep 2015 18:54:12 +0200 Original-Received: from localhost ([::1]:39650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBIa-0007gd-E9 for guile-bugs@m.gmane.org; Wed, 02 Sep 2015 12:54:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBIU-0007e8-Rp for bug-guile@gnu.org; Wed, 02 Sep 2015 12:54:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXBIQ-0001mi-O3 for bug-guile@gnu.org; Wed, 02 Sep 2015 12:54:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBIQ-0001mW-KA for bug-guile@gnu.org; Wed, 02 Sep 2015 12:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZXBIQ-0007e0-Bi for bug-guile@gnu.org; Wed, 02 Sep 2015 12:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 02 Sep 2015 16:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20907 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 20907-submit@debbugs.gnu.org id=B20907.144121282229355 (code B ref 20907); Wed, 02 Sep 2015 16:54:02 +0000 Original-Received: (at 20907) by debbugs.gnu.org; 2 Sep 2015 16:53:42 +0000 Original-Received: from localhost ([127.0.0.1]:46667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXBI6-0007dP-3I for submit@debbugs.gnu.org; Wed, 02 Sep 2015 12:53:42 -0400 Original-Received: from world.peace.net ([50.252.239.5]:45164) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXBI3-0007dH-W3 for 20907@debbugs.gnu.org; Wed, 02 Sep 2015 12:53:40 -0400 Original-Received: from [10.1.10.32] (helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ZXBHv-0000U1-2u; Wed, 02 Sep 2015 12:53:31 -0400 In-Reply-To: <87r3mg23wc.fsf@netris.org> (Mark H. Weaver's message of "Wed, 02 Sep 2015 12:16:03 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7841 Archived-At: Mark H Weaver writes: > Mike Gran writes: > >>> On Wednesday, September 2, 2015 5:09 AM, Ludovic Court=C3=A8s wrote: >> >>> I think the manual is correct: global C variables were *not* scanned by >>> the GC. > >> For what it is worth, the effect that I was seeing that made me >> question the documentation can be demonstrated by the attached program, >> where two 100MB Guile strings are stored in a C globals: one protected >> and one not.=20 >> >> >> In 1.8, a GC operation reduces memory from 200MB to 100MB, which I >> assume is freeing the memory from the unprotected string. > > I'm not sure why this result would make you question the current > documentation. To my mind, it clearly confirms what Ludovic wrote. > > If global C variables were scanned by default in 1.8, as you asserted, > then why would the unprotected string have been freed? It occurs to me that this confusion might have arisen from a lack of knowledge about garbage collection and what it means to "scan" something. "Scanning" is more or less a synonym for "marking", where the reachable objects are first marked starting from the roots, and after that's done, anything that is not marked will be freed in the sweep phase. I wonder if Mike might have been thinking that something cannot be freed unless it is scanned, so if it is freed that is evidence that it was scanned. In fact, scanning (marking) is necessary to *prevent* freeing, not to enable it. Mark