Using Mono SGen Garbage Collector in C / C ++ Programs

Is it possible to use the SGen garbage collector (from a mono executable program) in C / C ++ coventionnal programs? I think that mono also used the conservative Boehm-Demers-Weiser garbage collector , which can be used in C / C ++ programs.

+3
source share
2 answers

SGen has very few dependencies on the rest of the Mono code, so it’s easy to extract and adapt to other applications. The main difference from the Boehm collector is that it currently does not support inaccurate mode for heap objects, so you cannot use it to simply replace malloc. However, it would work just fine to manage the objects for which you could provide accurate reference information.

+7
source

Not sure about the garbage collector you specified. But do you really need to use GC on a C ++ project? I have never felt the use of GC in my C ++ projects. You have to be good if you follow the best practices and use a decent smart pointer.

-2
source

Source: https://habr.com/ru/post/1782614/


All Articles