On Thursday, 8 February 2018 at 01:53:43 UTC, Walter Bright wrote:
On 2/7/2018 11:29 AM, Ralph Doncaster wrote:
I just did a quick check, and with DMD v2.078.1, the hexString
template increases code size by ~300 bytes vs the hex literal.
So yet one more reason to prefer the hex literals.
Indeed it does, and that is the result of a poor implementation
of hexString. I've figured out how to fix that, and hope to
make a PR for it shortly.
https://issues.dlang.org/show_bug.cgi?id=18397
While the fix is a huge improvement, it doesn't match the code
generated by the hex literals. hexString!"deadbeef" stores the
null-terminated string in the data section of the object file,
while x"deadbeef" only stores 4 bytes in the data section.