GNU bug report logs -
#20907
[PATCH] Manual bug for scm_gc_protect_object
Previous Next
Reported by: Mike Gran <spk121 <at> yahoo.com>
Date: Fri, 26 Jun 2015 23:05:02 UTC
Severity: normal
Tags: patch
Done: Andy Wingo <wingo <at> pobox.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> On Wednesday, September 2, 2015 9:16 AM, Mark H Weaver <mhw <at> 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
This bug report was last modified 9 years and 27 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.