Improve the OOP ABI

deadalnix deadalnix at gmail.com
Fri Sep 29 12:33:13 UTC 2023


On Friday, 29 September 2023 at 12:15:53 UTC, Guillaume Piolat 
wrote:
> On Thursday, 28 September 2023 at 15:39:22 UTC, deadalnix wrote:
>>> I think it's the same in C++, and sometimes dynamic_cast ends 
>>> up making string comparisons.
>>
>> What's the reason for this madness?
>
> For example for GCC => 
> https://github.com/gcc-mirror/gcc/blob/41d6b10e96a1de98e90a7c0378437c3255814b16/libstdc%2B%2B-v3/libsupc%2B%2B/typeinfo#L48
>
> MSVCR => 
> https://github.com/ojdkbuild/tools_toolchain_vs2017bt_1416/blob/master/VC/Tools/MSVC/14.16.27023/crt/src/vcruntime/rtti.cpp#L27
>
> I don't understand any of it, just read "strcmp" in a profiler 
> once in a big C++ app. It turns out it was RTTI which was 
> taking a small percentage of time.

At least the GCC one has some explaination. What stroke me is:

> but even with weak symbols sometimes names are not merged
> when objects are loaded with RTLD_LOCAL

Which seems to indicate the duplication is not a fatality, but 
they have to handle it because they might be working with stuff 
that are loaded with RTLD_LOCAL? What does this mean? is this 
really a constraint that we have?


More information about the Digitalmars-d mailing list