[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scm_remember
From: |
Marius Vollmer |
Subject: |
Re: scm_remember |
Date: |
04 Nov 2000 20:19:12 +0100 |
User-agent: |
Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 |
Dirk Herrmann <address@hidden> writes:
> > For example:
> >
> > SCM str;
> > char *chars = SCM_STRING_CHARS (str);
> > some_syscall (chars);
> > str = SCM_BOOL_F;
> > scm_remember (&str);
> >
> > will ensure that the object originally pointed to by `str' is properly
> > protected, [...]
>
> Hmmm. I don't think so. Why should the original content of str be
> protected in this case?
Because I thought that the compiler will keep the location that holds
the pointer visible to the GC. I don't know if it is required to do
so.
> You rather protect the new content, namely #f. In the moment when
> scm_remember (&str) is called, the str object already holds the new
> value, and this is also obvious for the compiler. Thus, compiler
> _knows_ that &str is a pointer to the value SCM_BOOL_F.
Maybe you are right. The current method seems to work well in
practice, nevertheless.
> Thus, the implications of scm_remember (&str) are less obvious. Even
> worse, they are dependent of the compiler's knowledge.
Ok, I think I get it. Thanks for explaining this so thoroughly! I
don't feel competent in this issue, and I am pretty much convinced
that you have it right. I still want to be conservative here. I
don't see a immediate need to change it, because the current setup
seems to work, so we should proceed carefully. Anyone else has an
opinion on this? Maybe you could check with Aubrey?