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 14:05:30 -0400 Message-ID: <87h9nc1ytx.fsf@netris.org> References: <87r3mg23wc.fsf@netris.org> <572469453.502254.1441213951447.JavaMail.yahoo@mail.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1441217244 15096 80.91.229.3 (2 Sep 2015 18:07:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 18:07: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 20:07:16 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 1ZXCRH-0002mR-To for guile-bugs@m.gmane.org; Wed, 02 Sep 2015 20:07:16 +0200 Original-Received: from localhost ([::1]:40153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXCRH-0002gs-Hx for guile-bugs@m.gmane.org; Wed, 02 Sep 2015 14:07:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXCR8-0002ar-Rs for bug-guile@gnu.org; Wed, 02 Sep 2015 14:07:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXCR5-0007TC-L0 for bug-guile@gnu.org; Wed, 02 Sep 2015 14:07:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXCR5-0007Sx-Hk for bug-guile@gnu.org; Wed, 02 Sep 2015 14:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZXCR5-0001hg-8p for bug-guile@gnu.org; Wed, 02 Sep 2015 14:07:03 -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 18:07:03 +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.14412171756465 (code B ref 20907); Wed, 02 Sep 2015 18:07:03 +0000 Original-Received: (at 20907) by debbugs.gnu.org; 2 Sep 2015 18:06:15 +0000 Original-Received: from localhost ([127.0.0.1]:46698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXCQJ-0001gD-1M for submit@debbugs.gnu.org; Wed, 02 Sep 2015 14:06:15 -0400 Original-Received: from world.peace.net ([50.252.239.5]:45227) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXCQH-0001g4-Jx for 20907@debbugs.gnu.org; Wed, 02 Sep 2015 14:06:14 -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 1ZXCQB-0000oJ-3G; Wed, 02 Sep 2015 14:06:07 -0400 In-Reply-To: <572469453.502254.1441213951447.JavaMail.yahoo@mail.yahoo.com> (Mike Gran's message of "Wed, 2 Sep 2015 17:12:31 +0000 (UTC)") 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:7843 Archived-At: Mike Gran writes: > In the "Garbage Collection" of the manual in both 1.8 and 2.0, > it says that in 1.8, that "global variables of type SCM ... can be made > visible to the garbage collector by calling the functions scm_gc_protect". > (That's a typo I guess. It should say scm_gc_protect_object, I > think.) Indeed, good catch! Fixed in 4c5788d1ab14550afd86117e96f91164fbe04a72. > The implication is that if I do not call scm_gc_protect_object, my > global is still "invisible" and thus can't be freed by the GC. But my > "invisible" global in 1.8 is being freed and in 2.0 it is not freed. Here's the crux of the confusion: it's not the global variable that is being freed here. The variable only holds a *reference* to the heap-allocated string. That may seem pedantic, but it's a crucial distinction here. Anything in the heap that is not referenced from somewhere visible to the GC is freed. Would it help to replace all uses of the term "scan" with "mark", in connection with garbage collection? In the papers I've read on GC, "mark" is the word I usually see, and it seems much clearer to me, because anyone who knows the basics of GC knows that "marking" is needed to prevent an object from being freed, whereas "scanning" could mean anything. If you have other ideas of how to make this more clear, I'm open to suggestions. Thanks! Mark