[D-runtime] dup attributes?
Steve Schveighoffer
schveiguy at yahoo.com
Wed Aug 4 10:19:41 PDT 2010
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
>
More information about the D-runtime
mailing list