inverse of std.demangle?
Adam D. Ruppe
destructionator at gmail.com
Thu Jul 11 05:39:40 PDT 2013
On Thursday, 11 July 2013 at 01:32:33 UTC, H. S. Teoh wrote:
> I think this is a general problem of array and AA literals
> allocating at runtime (and sometimes *every single time* the
> literal is used).
Aye, it is. Even here it was doing it on every single loop
iteration. Disgusting. I was hoping setting it as an enum would
ctfe it and just be static data, but nope.
Anyway, I updated the file (forgive me if this posts multiple
times, I tried last night but my internet died). It is up here
now too:
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/mangle.d
It is allocation-free, except for the keyword list literal. Ugh.
(This could be avoided if I sorted it manually but meh i'm lazy).
Uses static stack buffers for its scratch space.
Now handled more complex function signatures too, compile with
-unittest and take a look.
I think this is probably all I'll do on this for now, but it
should be pretty useful as is.
More information about the Digitalmars-d-learn
mailing list