unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: 20907@debbugs.gnu.org, Mike Gran <spk121@yahoo.com>
Subject: bug#20907: [PATCH] Manual bug for scm_gc_protect_object
Date: Wed, 02 Sep 2015 14:08:52 +0200	[thread overview]
Message-ID: <87a8t5c9bf.fsf@gnu.org> (raw)
In-Reply-To: <87wpw97f9i.fsf@netris.org> (Mark H. Weaver's message of "Tue, 01 Sep 2015 21:59:21 -0400")

Mark H Weaver <mhw@netris.org> skribis:

> Mike Gran <spk121@yahoo.com> writes:
>> Manual claims C globals weren't scanned by GC in 1.8.  The opposite
>> is true.
>
> Ludovic wrote that text in 2009, commit
> f07c349eb38d6c7b160b8980fc4007fb502e3433.

I think the manual is correct: global C variables were *not* scanned by
the GC.  As an example, see ‘scm_sys_protects’ in 1.8: It’s a global
array that was explicitly scanned by the GC, because that’s basically
the only mechanism to add new GC root:

  j = SCM_NUM_PROTECTS;
  while (j--)
    scm_gc_mark (scm_sys_protects[j]);

The 1.8 manual reads:

     Other references to 'SCM' objects, such as global variables of type
  'SCM' or other random data structures in the heap that contain fields of
  type 'SCM', can be made visible to the garbage collector by calling the
  functions 'scm_gc_protect' or 'scm_permanent_object'.  You normally use
  these funtions for long lived objects such as a hash table that is
  stored in a global variable.  For temporary references in local
  variables or function arguments, using these functions would be too
  expensive.

http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Garbage-Collection.html

So I think we can close as ‘notabug’?  :-)

Ludo’.





  reply	other threads:[~2015-09-02 12:08 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 [this message]
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
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=87a8t5c9bf.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=20907@debbugs.gnu.org \
    --cc=mhw@netris.org \
    --cc=spk121@yahoo.com \
    /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).