This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: String representation proposal
- To: djurfeldt at nada dot kth dot se
- Subject: Re: String representation proposal
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 27 Aug 2000 19:20:50 +0200
- Cc: Gary Houston <ghouston at arglist dot com>
- Cc: guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <E13Spds-00008T-00@mdj.nada.kth.se><xy7g0nqr5xo.fsf@mdj.nada.kth.se>
- Reply-To: djurfeldt at nada dot kth dot se
Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> > Say there were two strings pointing to one shared character record:
> >
> > A -> <a>
> >
> > B -> <a>
> >
> > What if there are no references to A and <a> is <white, shared>.
> > GC mark doesn't reach <a> through A. However it reaches <a> through B
> > and changes it to <black, private>. GC sweep frees A and then
> > frees <a>.
> >
> > On the other hand what if there are no references to A or B? Now
> > <a> remains <white, private> and is freed twice. Hmmm.
Actually, the first problem above is only a problem in my
specification. The sweep phase should of course not free anything
which is black, because the blackness indicates that the record is in
use.
The second problem is serious, however. In fact, we can't even allow
following the reference to <a> the second time, because that memory is
freed!
I guess we have to delay freeing of character records until all cells
have been swept, similar to how certain other mechanisms work (weak
pointers, guardians, struct freeing etc).
Further suggestions?