ivmai / bdwgc

The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)

Home Page:https://www.hboehm.info/gc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add examples collection of small programs showing how to use GC for varioues features and with different configurations

plajjan opened this issue · comments

I'd like to suggest the addition of a collection of small programs that show how the GC can be used, e.g. in a examples/ directory. I think the primary point of the example programs is to be as simple as possible as to explain a particular concept.

The test suite is the closest thing we have to examples today but it is riddled with preprocessor conditions and defines which can make it difficult to read and gctest tests many many things, again making it hard to take in a particular concept.

I don't think it is possible to maintain a comprehensive set of example programs, i.e. having examples that demonstrate all aspects of the GC. But I do think it is possible to maintain a reasonable set of programs that demonstrate some common use cases. The addition of new examples can be entirely best-effort.

In order to maintain relevance, the example collection should be tested in CI though, to ensure it is working.

Okay. Please let me know how do you think it should be (I think a draft PR with a single sample would be enough to explain the proposed architecture).
I think the samples should be treated as small tests (and be a part of make check).

If convenient, I think we could consider using some popular framework, e.g. Cpputest.