|
|
|
|
|
by MaulingMonkey
1854 days ago
|
|
Technically, but they tend to be much harder to hack on. It's trivial to replace malloc/free with my_malloc/my_free - and integrating libraries that replace malloc/free as-is without renaming also tends to be straightforward. In C++, you can overload new/delete to use my_* with little hassle, or placement new to instantiate classes on previously allocated memory directly. Meanwhile, C# and Java provide absolutely no means of creating instances of their classes via anything other than their built-in GCs. You can't just distribute a .exe or .jar with a replaced GC - instead, you need to create/distribute/install an entirely new runtime, and even that doesn't really provide any sane means of having multiple GCs living side by side. This is all theoretically technically possible, but orders of magnitude more work. |
|
You can provide your own GC on .NET via the COM API.
https://github.com/Potapy4/dotnet-coreclr/blob/master/Docume...
Just like Java since version 10, https://medium.com/@unmeshvjoshi/writing-your-own-garbage-co...