No, no and no. toUTFz could be called at compile-time. Absolutely no extra run-time allocations, absolutely no run-time overhead.<br><br><div class="gmail_quote">On Tue, May 15, 2012 at 11:05 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com" target="_blank">jmdavisProg@gmx.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tuesday, May 15, 2012 17:35:58 Gor Gyolchanyan wrote:<br>
> Even if it's wrong to move writef to druntime, the toUTFz is still a very<br>
> small word to write.<br>
<br>
</div>Using toStringz or toUTFz instead of having string literals be zero-terminated<br>
would force allocating extra strings (string literals are in an RO portion of<br>
memory - at least on Linux - so you can't append to them without<br>
reallocating).<br>
<br>
Making it so that string literals weren't null terminated would break a _lot_<br>
of code for little-to-no benefit and a definite cost. I really don't see the<br>
problem with "" being different from cast(string)[] - particularly when the<br>
fact that "" is non-null is _useful_.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Jonathan M Davis<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>