unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Re: gc question
  2011-05-09  9:14 gc question rm
@ 2011-05-09  9:05 ` rixed
  2011-05-09  9:34   ` rm
  2011-05-09 10:00 ` Andy Wingo
  1 sibling, 1 reply; 5+ messages in thread
From: rixed @ 2011-05-09  9:05 UTC (permalink / raw)
  To: guile-user

-[ Mon, May 09, 2011 at 11:14:11AM +0200, rm@tuxteam.de ]----
> am I correct in assuming that the return value from
> scm_from_locale_keyword("unknown"); 
> won't ever be garbage collected od do I have to protect 
> it?

From an IRC discussion some time ago:

16:11 < rixed> BTW, is it required to scm_gc_protect_object a symbol ?
16:11 < civodul> no
16:13 < rixed> civodul: even with guile 1.8?
16:14 < civodul> in 1.8 you have to protect it
16:14 < civodul> but you should use the snarfing macros
16:14 < civodul> SCM_SYMBOL and SCM_GLOBAL_SYMBOL
16:14 < rixed> civodul: well, probably, but that's my first project using guile so I'd rather do it by hand - I find it actualy simpler :)
16:14 < dsmith-work> Wasn't there some recent changes that allow symbols to be gc'd?
16:16 < civodul> rixed: ok; so if you want both 1.8 and 1.6, then always scm_gc_protect_object
16:16 < civodul> s/1.6/2.0/
16:29 < rixed> civodul: will do. thanx!

So I'd say it depends on the target guile version.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gc question
  2011-05-09  9:34   ` rm
@ 2011-05-09  9:12     ` rixed
  0 siblings, 0 replies; 5+ messages in thread
From: rixed @ 2011-05-09  9:12 UTC (permalink / raw)
  To: guile-user

-[ Mon, May 09, 2011 at 11:34:21AM +0200, rm@tuxteam.de ]----
> But that talk was about symbols (which might well go aut of scope), im
> asking about _keywords_ whose semantics seem to be different.

Sorry I'm too new to notice the difference.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* gc question
@ 2011-05-09  9:14 rm
  2011-05-09  9:05 ` rixed
  2011-05-09 10:00 ` Andy Wingo
  0 siblings, 2 replies; 5+ messages in thread
From: rm @ 2011-05-09  9:14 UTC (permalink / raw)
  To: guile-user


Dear list,

am I correct in assuming that the return value from
scm_from_locale_keyword("unknown"); 
won't ever be garbage collected od do I have to protect 
it?

 TIA Ralf Mattes





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gc question
  2011-05-09  9:05 ` rixed
@ 2011-05-09  9:34   ` rm
  2011-05-09  9:12     ` rixed
  0 siblings, 1 reply; 5+ messages in thread
From: rm @ 2011-05-09  9:34 UTC (permalink / raw)
  To: rixed, guile-user

On Mon, May 09, 2011 at 11:05:42AM +0200, rixed@happyleptic.org wrote:
> -[ Mon, May 09, 2011 at 11:14:11AM +0200, rm@tuxteam.de ]----
> > am I correct in assuming that the return value from
> > scm_from_locale_keyword("unknown"); 
> > won't ever be garbage collected od do I have to protect 
> > it?
> 
> >From an IRC discussion some time ago:
> 
> 16:11 < rixed> BTW, is it required to scm_gc_protect_object a symbol ?
> 16:11 < civodul> no
> 16:13 < rixed> civodul: even with guile 1.8?
> 16:14 < civodul> in 1.8 you have to protect it
> 16:14 < civodul> but you should use the snarfing macros
> 16:14 < civodul> SCM_SYMBOL and SCM_GLOBAL_SYMBOL
> 16:14 < rixed> civodul: well, probably, but that's my first project using guile so I'd rather do it by hand - I find it actualy simpler :)
> 16:14 < dsmith-work> Wasn't there some recent changes that allow symbols to be gc'd?
> 16:16 < civodul> rixed: ok; so if you want both 1.8 and 1.6, then always scm_gc_protect_object
> 16:16 < civodul> s/1.6/2.0/
> 16:29 < rixed> civodul: will do. thanx!
> 
> So I'd say it depends on the target guile version.

But that talk was about symbols (which might well go aut of scope), im
asking about _keywords_ whose semantics seem to be different.


 Cheers, RalfD




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gc question
  2011-05-09  9:14 gc question rm
  2011-05-09  9:05 ` rixed
@ 2011-05-09 10:00 ` Andy Wingo
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2011-05-09 10:00 UTC (permalink / raw)
  To: rm; +Cc: guile-user

On Mon 09 May 2011 11:14, rm@tuxteam.de writes:

> am I correct in assuming that the return value from
> scm_from_locale_keyword("unknown"); 
> won't ever be garbage collected od do I have to protect 
> it?

I was about to answer:

   No, this is not correct.  Keywords can be garbage-collected.

However it does seem that currently, keywords are never
garbage-collected.  That's probably a bug, though.

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-09 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09  9:14 gc question rm
2011-05-09  9:05 ` rixed
2011-05-09  9:34   ` rm
2011-05-09  9:12     ` rixed
2011-05-09 10:00 ` Andy Wingo

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).