endsWith() doesn't work with const(wchar[])s

Steven Schveighoffer schveiguy at yahoo.com
Sat Jan 15 09:18:18 PST 2011


On Sat, 15 Jan 2011 12:16:32 -0500, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:

> On Fri, 14 Jan 2011 20:54:39 -0500, %u <wfunction at hotmail.com> wrote:
>
>>> What you really want is for IFTI to strip down const/immutable on  
>>> arrays and
>> basic types.  I think it's a bugzilla bug somewhere, if not it's  
>> definitely been
>> discussed on the phobos mailing list.
>>
>> Ah, all right then, nice!
>>
>>
>>> Since 2.041, this cannot happen.  A resize of a slice where data will  
>>> be
>> overwritten from the original array always results in a reallocation.
>>
>> So I assume the same is true if you try to resize a slice of  
>> non-GC-managed memory
>> (even if it won't overwrite anything), correct? That's comforting to  
>> know, thank
>> you! :)
>
> A resize of non-GC-managed memory will always reallocate on the GC,  
> because it has no information on it.

Actually, I'll go one further: A resize of non-GC-array memory (memory  
allocated in any way other than new T[]) will not resize in place, simply  
because the information to allow resizing doesn't exist.  This change is  
more recent however, I think circa 2.048?

-Steve


More information about the Digitalmars-d mailing list