Thread overview
-fno-rtti (disable RTTI)?
May 13
IGotD-
May 13
kinke
May 14
kinke
May 13
Hi!

Is there any way to disable RTTI? Perhaps some simple compiler patch?
May 13
On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin wrote:
> Hi!
>
> Is there any way to disable RTTI? Perhaps some simple compiler patch?

What is RTTI in a D language context? -fno-rtti is a switch for C++ compilers and I'm not sure what the equivalent in D would be. Would that be the module info meta data?
May 13
On Wednesday, 13 May 2020 at 10:10:13 UTC, IGotD- wrote:
> On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin wrote:
>> Hi!
>>
>> Is there any way to disable RTTI? Perhaps some simple compiler patch?
>
> What is RTTI in a D language context? -fno-rtti is a switch for C++ compilers and I'm not sure what the equivalent in D would be. Would that be the module info meta data?

Yes, I mean this thing - text names of types and stuff like that.

Maybe you remember that I am trying to port druntime to an embedded system. Now I have a binary about 90KB and I have a suspicion that several kilobytes occupied by type information and exceptions messages.
May 13
On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin wrote:
> Is there any way to disable RTTI?

TypeInfos aren't emitted if there's no class TypeInfo in object.d. But then obviously everything that depends on them doesn't work, like associative arrays and GC allocations. - If a struct's TypeInfo isn't used, it should be stripped by the linker.
May 13
On 13 May 2020, at 13:09, kinke via digitalmars-d-ldc wrote:
> TypeInfos aren't emitted if there's no class TypeInfo in object.d. But then obviously everything that depends on them doesn't work, like associative arrays and GC allocations. - If a struct's TypeInfo isn't used, it should be stripped by the linker.

In addition to this, there are also LDC_no_moduleinfo/LDC_no_typeinfo for more fine-grained control; see https://wiki.dlang.org/LDC-specific_language_changes#Pragmas. (I haven't use those myself in a while.)

 — David
May 14
On Wednesday, 13 May 2020 at 12:09:09 UTC, kinke wrote:
> On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin wrote:
>> Is there any way to disable RTTI?
>
> TypeInfos aren't emitted if there's no class TypeInfo in object.d. But then obviously everything that depends on them doesn't work, like associative arrays

Hmm, is suddenly for me. Why AAs needs TypeInfo?
May 14
On Thursday, 14 May 2020 at 16:05:41 UTC, Denis Feklushkin wrote:
> Hmm, is suddenly for me. Why AAs needs TypeInfo?

See https://github.com/dlang/druntime/blob/master/src/rt/aaA.d - apparently for hashing & equality of keys, plus destruction of keys & values.