[D-runtime] dup attributes?
Sean Kelly
sean at invisibleduck.org
Thu Aug 5 16:15:19 PDT 2010
Concatenation doesn't preserve bit flags? Like if I do this:
mystr ~= "a" ~ "b";
You're saying that it's possible for the bits set on mystr to be lost?
On Aug 4, 2010, at 10:19 AM, Steve Schveighoffer wrote:
> One more thing -- concatenation suffers from the same problem. This one might
> be much harder to swallow since you may have to do N flag lookups.
>
> -Steve
>
>
>
> ----- Original Message ----
>> From: Steve Schveighoffer <schveiguy at yahoo.com>
>> To: d-runtime <d-runtime at puremagic.com>
>> Sent: Wed, August 4, 2010 8:32:38 AM
>> Subject: [D-runtime] dup attributes?
>>
>> Currently, in the array runtime code, all appends and length settings copy the
>
>> BlkAttr attributes from the existing block to the new block. This is
>> important
>>
>> if you set block attributes other than the default, or you are appending to a
>
>> block which is currently typed differently than what it was when allocated.
>>
>> However, the one function which does *not* do this is dup. dup uses the
>> typeinfo to determine the block attributes, including the NO_SCAN flag.
>>
>> I think it should copy the attributes like all the other functions do.
>> However,
>>
>> there is one caveat to this. Currently dup doesn't look up the block
>> attributes
>>
>> of the existing data, because it doesn't have to. So changing dup to copy the
>>
>> attributes would slow down dup a bit because in addition to allocating a new
>> block, it must look up the flags for the old block.
>>
>> What do you guys think?
>>
>> -Steve
>>
>>
>>
>>
>> _______________________________________________
>> D-runtime mailing list
>> D-runtime at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/d-runtime
>>
>
>
>
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime
More information about the D-runtime
mailing list