Ghassen Hamrouni
Ghassen Hamrouni

Reputation: 3168

Using Mono SGen Garbage collector in C/C++ programs

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

Upvotes: 3

Views: 823

Answers (2)

lupus
lupus

Reputation: 3973

There are very few dependencies on the rest of the Mono code in SGen, so it should be easy to extract it out and adapt to other uses. The major difference from the Boehm collector is that it currently doesn't support a non-precise mode for heap objects, so you can't use it to replace malloc easily. It would work great, though, for managing objects for which you could provide precise reference information.

Upvotes: 8

Navaneeth K N
Navaneeth K N

Reputation: 15541

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

Upvotes: -2

Related Questions