Why is D's GC slower than GO's?

Paulo Pinto pjmlp at progtools.org
Sun Oct 30 06:48:39 UTC 2022


On Sunday, 30 October 2022 at 01:51:46 UTC, Walter Bright wrote:
> On 10/29/2022 1:11 PM, Paulo Pinto wrote:
>> Again mixing languages,
>> 
>> __gc is from Managed C++, .NET 1.0
>> 
>> C++/CLI, .NET 2.0 onwards, uses ^ for reference types and 
>> gcnew for GC heap.
>
> What's the difference between __gc* and ^ ?

Between Managed C++ and C++/CLI, none.

The latter replaces the former, Managed C++ died with .NET 2.0 
release.

If we also bring C++/CX into the picture, ^ is a tracing GC 
pointer to .NET types in C++/CLI, while on C++/CX it is compiler 
native support for COM types with the compiler doing 
AddRef/Release calls on its own.

In modern native frameworks, WRL, WIL and C++/WinRT, the ^ get 
replaced by library smart pointer classes.


More information about the Digitalmars-d mailing list