unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: Mark H Weaver <mhw@netris.org>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"20907@debbugs.gnu.org" <20907@debbugs.gnu.org>
Subject: bug#20907: [PATCH] Manual bug for scm_gc_protect_object
Date: Wed, 2 Sep 2015 17:12:31 +0000 (UTC)	[thread overview]
Message-ID: <572469453.502254.1441213951447.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <87r3mg23wc.fsf@netris.org>

> On Wednesday, September 2, 2015 9:16 AM, Mark H Weaver <mhw@netris.org> wrote:
 > If global C variables were scanned by default in 1.8, as you asserted,
> then why would the unprotected string have been freed?
> 
> Am I missing something?

I apologize in advance for the pedantry below.

Maybe I just don't understand GC nomenclature.
 
I thought that if a global variable were not "scanned" by a garbage
collector, it would be invisible to the garbage collector, and could
not be freed by the garbage collector. 
 
The footnote in question says that for 1.8, globals were not
"scanned", which I understood to mean that globals were invisible to
to the garbage collector and could not be freed by the GC.
 
The implication is that, for 2.0, globals were "scanned", which I
understood to mean that they were visible to the GC and could be freed.
 
My test program shows that globals are GC'd in 1.8, but, not 2.0.
 
That is why I believe the logic of the footnote to be wrong, and that the
"not" should be removed.
 
But I guess from context that you and Ludo have a different definition
for "to scan", and that scanning protects something from being GC'd?
 
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.)
 
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.
 
The only mention of the difference between 1.8 and 2.0 is in the footnote
in question.
 
Look, it is fine, though.  Don't waste your time on this if I'm just
confused.
 
Thanks,
 
Mike 





  parent reply	other threads:[~2015-09-02 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 23:00 bug#20907: [PATCH] Manual bug for scm_gc_protect_object Mike Gran
2015-09-02  1:59 ` Mark H Weaver
2015-09-02 12:08   ` Ludovic Courtès
2015-09-02 15:36     ` Mike Gran
2015-09-02 16:16       ` Mark H Weaver
2015-09-02 16:52         ` Mark H Weaver
2015-09-02 17:12         ` Mike Gran [this message]
2015-09-02 18:05           ` Mark H Weaver
2015-09-02 18:34             ` Mike Gran
2016-06-24  6:58               ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572469453.502254.1441213951447.JavaMail.yahoo@mail.yahoo.com \
    --to=spk121@yahoo.com \
    --cc=20907@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).