Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 30, 2018 [Issue 18338] typeid expression causes typeInfo to be duplicated | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18338 Benjamin Thaut <code@benjamin-thaut.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- |
January 30, 2018 [Issue 18338] typeid expression causes typeInfo to be duplicated | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18338 kinke@gmx.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kinke@gmx.net --- Comment #1 from kinke@gmx.net --- (In reply to Benjamin Thaut from comment #0) > Typeid expressions should only instanciate the type info > if the typeid expression is part of a root module. I guess that's not enough for a shared `typeid(SomeSharedType)` expression in both a root module of the DLL and in a root module of the other lib/executable. There probably has to be a clear ownership by emitting the TypeInfo and its helper functions once in the declaring/template-instantiating module/object. How are colliding TypeInfo symbols across shared objects handled on Linux? -- |
February 01, 2018 [Issue 18338] typeid expression causes typeInfo to be duplicated | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18338 --- Comment #2 from Benjamin Thaut <code@benjamin-thaut.de> --- (In reply to kinke from comment #1) > > I guess that's not enough for a shared `typeid(SomeSharedType)` expression in both a root module of the DLL and in a root module of the other lib/executable. There probably has to be a clear ownership by emitting the TypeInfo and its helper functions once in the declaring/template-instantiating module/object. > > How are colliding TypeInfo symbols across shared objects handled on Linux? The linux shared library mechanism automatically deduplicates duplicated symbols. For linux both the symbol name binding and the address resolving happens at binary load time. For linux the symbol name binding happens at link time and only the address resloving happens at load time. As a result the windows shared library mechanism doesn't deduplicate symbols. The critical part is that the type infos for all user defined types (structs / classes / enums etc) have a clear ownership. E.g. are always emitted alongside the definition of the user defined type. Because these are what is used for casts and other type info critical operations. Other type info such as const array etc can be duplicated without impact. The bug here really is though that the typeinfo will be emitted twice due to the typeid statement. Once when compiling file.d and once when compiling test.d. Emitting it while compiling test.d is a bug in my opinion. -- |
December 17, 2022 [Issue 18338] typeid expression causes typeInfo to be duplicated | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18338 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 -- |
December 13 [Issue 18338] typeid expression causes typeInfo to be duplicated | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18338 --- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19375 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation