Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template value parameter cause too long mangling #18695

Open
dlangBugzillaToGithub opened this issue Oct 13, 2013 · 0 comments
Open

template value parameter cause too long mangling #18695

dlangBugzillaToGithub opened this issue Oct 13, 2013 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

Martin Nowak (@MartinNowak) reported this on 2013-10-13T13:39:20Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=11248

CC List

Description

// 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant