guile-devel
[Top][All Lists]
Advanced

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

Re: The empty string and other empty strings


From: David Kastrup
Subject: Re: The empty string and other empty strings
Date: Tue, 10 Jan 2012 16:48:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Mark H Weaver <address@hidden> writes:

> Mike Gran <address@hidden> wrote:
>>> Right now it seems that zero-length shared substring of a wide string is
>>> wide.  A zero-length substring still shares the stringbuf of the
>>> original string.
>> [...]
>>> What do you think about that?  Do zero-length substrings need to
>>> still share stringbufs with their parent strings?
>
> I wrote:
>> I think the answer is: no they don't, and avoiding that might be a
>> worthwhile optimization, mainly to avoid needlessly holding a reference
>> to a potentially large stringbuf.
>
> I went ahead and committed this optimization.  Empty substrings are now
> always freshly allocated, and never hold a reference to the original
> stringbuf.

Why would they need an allocation at all?  They don't contain
characters.

-- 
David Kastrup




reply via email to

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