Interesting Memory Optimization

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 16 07:28:39 PDT 2012


On Fri, Mar 16, 2012 at 08:24:34AM -0400, Kevin Cox wrote:
[...]
> And the previous examples were language agnostic.  In D and other
> languages where the length of a string is stored we can nest strings
> anywhere inside other strings.
> 
> const char[] a = "foofoo";
> const char[] b = "oof";
> 
> Those can't be nested in null terminated strings, bit they can where
> strings have an explicit length.

More to the point, does dmd perform this optimization currently?


T

-- 
Mediocrity has been pushed to extremes.


More information about the Digitalmars-d mailing list