mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] interning symbols weakly


From: Chris Hanson
Subject: Re: [MIT-Scheme-devel] interning symbols weakly
Date: Sat, 21 Nov 2009 14:26:19 -0800

Maybe change the global environment to be a hash table?  OK with me either way.

On Fri, Nov 20, 2009 at 9:57 PM, Taylor R Campbell <address@hidden> wrote:
> Attached is a patch[*] to intern symbols weakly, so that unused
> symbols can be garbage-collected.  This sounds like it should be
> trivial, but there is a complication because the `global' environment
> is represented implicitly by an extra slot in each symbol for its
> value in that environment.  To accomodate this, the patch strongly
> interns symbols bound in the global environment: defining or
> undefining a global variable strengthens or weakens its reference in
> the symbol table, which may have the consequence of slightly slowing
> down linking and interpreting definitions in the system global
> environment.
>
> I think I have covered all the cases in lookup.c requiring
> strengthening or weakening symbols; Scheme stably runs a test
> involving defining lots of symbols with randomly generated names in
> the system global environment and then undefining them, although that
> doesn't test everything.  A secondary GC daemon deletes broken entries
> from the symbol table if space is short.
>
> Comments (other than that the strengthening and weakening mechanism is
> a crock)?  Worth committing?  I think garbage-collecting symbols is
> the right thing -- the only question is whether this approach to
> making them collectable is too hairy.
>
> [*] Apply weaksym.patch with `patch -p1 < /path/to/weaksym.patch' from
>    the top level of the Git repository.
>
> _______________________________________________
> MIT-Scheme-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/mit-scheme-devel
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]