D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11248 - template value parameter cause too long mangling
Summary: template value parameter cause too long mangling
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords: mangling
Depends on:
Blocks:
 
Reported: 2013-10-13 13:39 UTC by Martin Nowak
Modified: 2024-12-13 18:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2013-10-13 13:39:20 UTC
// 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).
Comment 1 dlangBugzillaToGithub 2024-12-13 18:12:40 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18695

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB