Bug 11248 – template value parameter cause too long mangling

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-13T13:39:20Z
Last change time
2024-12-13T18:12:40Z
Keywords
mangling
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#18695 →

Comments

Comment #0 by code — 2013-10-13T13:39:20Z
// 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 by robert.schadek — 2024-12-13T18:12:40Z
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