www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11248] New: template value parameter cause too long mangling

http://d.puremagic.com/issues/show_bug.cgi?id=11248

           Summary: template value parameter cause too long mangling
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code dawg.eu



// huge tables
enum someData = [...];
enum someMoreData = [...];

template processData(alias data)
{
    // small result
    static immutable result = doSomething(data);
}

alias data = processData!someData;
alias moreData = processData!someMoreData;

----

The mangling becomes a problem because certain compile time data still ends up
in the object file. When using the above pattern to process compile time data
only the result should be part of the object file, but because the whole data
is part of the template mangling we end up with a huge symbol name and a big
object file.

I think a feasible solution is to abbreviate too long data in mangling by a
hash (MD5 or SHA1).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2013