guile-user
[Top][All Lists]
Advanced

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

Re: shared-substrings missing in 1.7


From: Roland Orre
Subject: Re: shared-substrings missing in 1.7
Date: Fri, 16 Jan 2004 14:49:54 +0100

On Fri, 2004-01-16 at 13:52, Marco Parrone wrote:
> Roland Orre on Fri, 16 Jan 2004 09:49:11 +0100 writes:
> 
> > In about half of my code I can easily replace make-shared-substring
> > with normal substring, as I there have used them for efficiecny
> > reasons only, but in the rest of the code the functionality of shared
> > substrings is essential so I need to reimplement them.
> 
> Why don't you copy the make-shared-substring code into a new Guile
> module?  So you can use it whithout needing to patch Guile (and so
> whithout needing to syncronize your modifications with the main tree).
> 
> Then all what you have to change will be adding and :use-module to the
> needed modules, right?

It is not that easy because the tag type substring scm_tc7_substring
doesn't exist at the moment. Further on will the garbage collector
not be aware about substrings, therefore I need to protect them, as
well as the original string so I can deallocate them in the right
order. I just tested this idea and got segmentation fault when I
deallocated just the original string. I'll probably have to implement
a deallocate_all_shared substrings as well.

Anyway, this is a simple solution to keep me going, my old code will
still work, but somewhat more messy, so it is not a long term solution.
I'm slightly worried what will happen with substrings in the future.

Neither do I understand the reason why removing explicitly shared
substrings and then later add implicit shared substrings as was the
intention. With implicit internal substrings, I see no reason to not
have explicit substrings as well. Even though make-shared-substring
would become unnecessary in the future if all substrings are 
shared, I consider it wrong to remove a facility before the
replacement implementation is done.

        Best regards
        Roland Orre






reply via email to

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